We want to publish a Maven POM that is useful to serve as the parent POM for various projects. Some of the projects that use the POM will be open source, but some will not be. To designate our parent POM as open source, we include this:
<licenses>
<license>
<name>Apache-2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
This essentially says, "this project is open source".
Unfortunately because of POM inheritance, any project that uses this parent POM will also effectively be saying "this project is also open source", because the effective POM of all descendant projects will also include this same license section.
Developers could try to remember to include some <licenses>
section to override this license, but the whole point of the parent POM is that it should given developers less to do, not more. Besides, some private projects (even ours) might not wish to indicate a license at all!
How can our public parent POM indicate that it is open source without effectively making all child projects open source as well through POM inheritance? Is there a POM setting to prevent the <licenses>
section from being inherited for example?
Update: I filed improvement request ticket MNG-7562 for this capability.
<inherited>false</inherited>
, but licenses are a different kettle of fish. – Calbert