1

How does a Java package published on Maven documents the provenance (origin and license) of an open source project packaged and published in such a public repo?

In particular what can I do to document and how should I document my code when I am the author and publisher of a package?

And what if this is a package (possibly modified) that I have not authored but that I only publish as Maven Central Jar?

3

1 Answer 1

1

If I understand your question correctly, you can simple add this information to your POM file. The following is an example from the Maven POM reference.

<licenses>
  <license>
    <name>Apache License, Version 2.0</name>
    <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
    <comments>A business-friendly OSS license</comments>
  </license>
</licenses>

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      https://maven.apache.org/xsd/maven-4.0.0.xsd">
  ...
  <organization>
    <name>Codehaus Mojo</name>
    <url>http://mojo.codehaus.org</url>
  </organization>
</project>

As for your last question, I'm not entirely sure what you're asking, but I would say point the URL to your fork.

4
  • Thanks. You mean point the url to your fork? which url? the license URL? Feb 9, 2017 at 14:50
  • The project URL @PhilippeOmbredanne
    – RubberDuck
    Feb 9, 2017 at 15:20
  • If I can put more than one license <tags>, would this mean that all the licenses apply or that this is a choice of licenses? Feb 9, 2017 at 22:46
  • I assume that would mean you're dual licensing @PhilippeOmbredanne, but that is just an assumption.
    – RubberDuck
    Feb 9, 2017 at 22:47

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.