Just again another licensing question... By now I read so much stuff about licensing that I'm totally confused.

Let's say I write two little java libraries and put it on github. One of them has a GPLv3 licensed dependency, the other one has a Apache-2.0 licensed dependency. Note that I'm just using these dependencies, not modifying them. Now I also want to deploy my libraries to maven so that every java developer can use them.

Now here are my questions:

  • What licenses do my libraries have to use (or can I choose it freely by myself)?
  • Do I have to provide some special information because of the dependencies, like a notice file which states what dependencies are used and who owns them etc.?

I'm sorry if this question might be a duplicate, I wasn't able to apply other questions/anwers to this scenario.

2 Answers 2


I can give you pointers based on my reading & experience.

If you are dependent on a code which is GPL & including GPL library/code in your code, your code should come under GPL as well.

If you use apache licensed code & including in your code, then you are free to choose any license. As Steve mentioned, you need to mention it in third party dependencies. This is kind of ThirdParty.txt or dependency section in readme.txt. You need to give the license link & the name of the library you are using.

Now if you want to use GPL & still release your code under different license:

If you are using GPL & providing your code as a free library (under any license), you should not include GPL in there. You can mention the dependency that certain library is required. In this case your code can be under any license. The user/client needs to decide & install/configure that code. You can do some GPL work to make that code as a compiled library, so your code can use it (Library is needed if your code is Java/C/C++.. If its python/perl/js, then client just need to put in correct folder)

The idea behind this is to detach your code from library. I know your code can't be used without that GPL library, however somebody can write non-gpl code for the same functionality in future. This way you keep your code detached from GPL till new code is available & still have your code with different license.

Now coming to selling of such code (not including GPL code, but mentioning dependency). You have to specifically mention the dependency on GPL & let clients download it/configure it (You can make this integration easy by some config)

Hope this helps you..

  • 1
    So using maven (thus not directly including GPL code in my library) I can still release my library under e.g. MIT license as long as I mention that there is this GPL dependency? Same for Apache-2.0 dependency + link to Apache-2.0 license?
    – SimonH
    Jun 25, 2017 at 13:25
  • That is tricky. Legal language is always ambiguous. Gnu.org (gnu.org/licenses/gpl-faq.en.htm) also does not give answer in yes/no. The answers have some conditions & strings attached (which might be ok from legal, but very frustrating for us). I would recommend you to play safe.. Do not use GPL or you publish your code as GPL.. As per me, do not even use it in maven too (for GPL).. For apache, I think it is ok to use it provided you mention it in thirdparty or legal notice.. Jun 25, 2017 at 16:07
  • I know several closed-source products using GPL plugins, where the download and installation of the GPL components happens by the end user (maybe supported by a download&installation feature inside the product). Though I cannot guarentee this is always 100% legally safe, it seems to be a popular method for attempting to circumvent the viral aspect of GPL.
    – Doc Brown
    Jun 27, 2017 at 10:59

In general every dependency should be clearly documented, regardless of where it comes from as without that dependency being met your code will not work! Since your code will not work without those dependencies being met you are using that code and must abide by it's licence conditions and will need to inform your users where they can get the required files, (and it is nice to mention the licences there).

For the legal licencing side of it you will have to consult the exact text of each applicable licence possibly with a legal expert on Open Source licences to find out what you are required and/or expected to do.

I would suggest asking on https://opensource.stackexchange.com/ mentioning the exact specific licence(s) that you need to know about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.