In my company, we have a library that makes use of a 3rd party library with an LGPL3 license.
Although our library does not extend or modify any of the 3rd party library's code, it provides some implementations for behaviour customization
- The 3rd party library allows this customization, and this is done using Java's ServiceLoader, where the library loads some custom implementation if it exists, else it will default to its own implementation
One of our worries about Java's ServiceLoader usage, is that there is no guarantee that our custom implementation will be the only one existing in the application's classpath, and therefore we can't guarantee that our implementation will be loaded
- If an application that uses our library also needs the 3rd party library for their own custom work, our custom implementation may be wrongly loaded for that application, or vice-versa, our library may load a custom implementation that will break our expected behaviour
To work around this, we thought of repackaging the Java packages of the library
- I'm speaking about java packages, and not repackaging a means of distribution
- For example, the application base package is org.third.party and our idea was to repackage the library so that its base package would be something like repackaged.org.third.party
- Similar to what jersey has done with guava, as they repackage it internally
- Not sure if they modify any of guava's code, but guava has an Apache 2 License
- This would be done using maven-shade-plugin with the relocate option
With this change we could ensure that our library implementation wouldn't "clash" with other custom implementations, because the repackaged library would be looking for an implementation under repackaged.org.third.party instead of org.third.party.
So, our doubt here is if this is allowed by the LGPL3 license. If so, what do we need to do to ensure compliance with the license?
- Although we are not explicitly extending and modifying the 3rd party library source code, this repackaging could be seen as code changes, since the repackaged library would have its Java package declarations and inner imports also changed
- According to the license, if any code change occurs, the source code must be made available - how should this be done? Should the source code be packaged together with the library, or it's only needed to make it available together with the repackaged library in a maven repository for example?
I tried searching StackOverflow/StackExchange for a similar question, but usually, the repackage that other LGPL posts refer to is related only to redistribution, or users are explicitly modifying the source code.