Search code examples
gradlegradle-pluginjcentermaven-central

is it Legal to publish module that has close-source dependencies to public source central


To be clear, I would like to publish my android library module to JCenter or Maven Central so that when the android developers would like to use my library they can directly add a simple line like compile 'a.b.c', instead of import module. So of course I am talking about gradle library module.

However, the bad news is my project has dependency on close-source libraries that are some jars from several other companies. So I don't know if it is legal to publish my module with the close-source jars.

I am not clear about whether it depends on the public source central law doc or the companies law doc.


Solution

  • I understand that your project has a dependency on a third-party (closed-source) jar that is not part of MavenCentral and you are not allowed to deploy this third-party jar to MavenCentral because of licensing issues.

    The first question is: Is this third-party jar available through some other openly available Maven repository? Many companies offer their own repositories to provide jars for their APIs etc.

    If it is not openly available, there is no use in putting your jar into MavenCentral. Anyone trying to use it breaks their build because the dependency could not be downloaded. It may even be forbidden.

    If your third-party dependencies are available, you could declare the necessary repositories in your pom to allow anybody to download the relevant dependencies.

    I don't know whether this violates the rules of MavenCentral. You should check that.