Maven JAR Plugin
  1. Maven JAR Plugin
  2. MJAR-42

Add LICENCE and NOTICE files to the jar

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Patch attached that adds project LICENSE and NOTICE files into the output jar. By default it will add LICENSE.txt and NOTICE.txt files from the project's basedir (if they are present) into the META-INF directory of the jar.

      1. mvn-jar-patch.txt
        3 kB
        Jeremy Boynes

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          568d 9h 10m 1 Olivier Lamy (*$^¨%`£) 14/Dec/07 18:06
          Mark Thomas made changes -
          Workflow jira [ 12959490 ] Default workflow, editable Closed status [ 12996265 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:05:23 UTC 2015 [ 1428278723217 ]
          Mark Thomas made changes -
          Workflow jira [ 12721936 ] Default workflow, editable Closed status [ 12759583 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 10:31:03 UTC 2015 [ 1428229863560 ]
          Olivier Lamy (*$^¨%`£) made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Won't Fix [ 2 ]
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          This is now dealt with by the remote resources plugin.

          Show
          Olivier Lamy (*$^¨%`£) added a comment - This is now dealt with by the remote resources plugin.
          Hide
          Jochen Wiedmann added a comment -

          I'd like to recall that Maven is an Apache project. In other words, if there is something like "Apache-specific", then the "Maven standard" should at least make it possible to follow.

          Additionally, I'd like to point out a problem with Bretts suggestion to use the <resource> mechanism: If I do specify a resource, which lives in the base directory, then I'll encounter problems while building a source jar: The maven-source-plugin will include my whole project into the jar file. (This may be a bug in the maven-source-plugin, I am unsure what to think of it.)

          Show
          Jochen Wiedmann added a comment - I'd like to recall that Maven is an Apache project. In other words, if there is something like "Apache-specific", then the "Maven standard" should at least make it possible to follow. Additionally, I'd like to point out a problem with Bretts suggestion to use the <resource> mechanism: If I do specify a resource, which lives in the base directory, then I'll encounter problems while building a source jar: The maven-source-plugin will include my whole project into the jar file. (This may be a bug in the maven-source-plugin, I am unsure what to think of it.)
          Hide
          Mike Perham added a comment -

          The license and notice files in the root of a project isn't a Maven standard (is it?) and plus I don't think it's a great idea anyways as it becomes repetitive in systems with large numbers of modules, all under the same license.

          I think a better idea is to add an element to the MANIFEST.MF with the value(s) of project.licenses.license:

          License-1-Name: Apache License, 2.0
          License-1-Url: http://apache.org/APL-2.0.txt
          License-2-Name: GNU Lesser General Public License, 1.1
          License-2-Url: http://gnu.org/LGPL-1.1.txt

          This way all modules can inherit their licenses via parent and have the manifest populated automatically.

          Show
          Mike Perham added a comment - The license and notice files in the root of a project isn't a Maven standard (is it?) and plus I don't think it's a great idea anyways as it becomes repetitive in systems with large numbers of modules, all under the same license. I think a better idea is to add an element to the MANIFEST.MF with the value(s) of project.licenses.license: License-1-Name: Apache License, 2.0 License-1-Url: http://apache.org/APL-2.0.txt License-2-Name: GNU Lesser General Public License, 1.1 License-2-Url: http://gnu.org/LGPL-1.1.txt This way all modules can inherit their licenses via parent and have the manifest populated automatically.
          Hide
          Brett Porter added a comment -
          • default values should be given with default-value instead of an initialising value (the basedir won't be correctly aligned otherwise)
          • this technique won't work especially well with multiple modules projects
          • I'm not sure we want the Apache-specific NOTICE file in here. Perhaps it should be a part of the license specification.

          Isn't a better workaround just to use the <resources> mechanism for this?

          Show
          Brett Porter added a comment - default values should be given with default-value instead of an initialising value (the basedir won't be correctly aligned otherwise) this technique won't work especially well with multiple modules projects I'm not sure we want the Apache-specific NOTICE file in here. Perhaps it should be a part of the license specification. Isn't a better workaround just to use the <resources> mechanism for this?
          Hide
          Jeremy Boynes added a comment -

          This patch provides a simple mechanism for adding the license files until the more flexible approach described in MJAR-10 can be implemented.

          Show
          Jeremy Boynes added a comment - This patch provides a simple mechanism for adding the license files until the more flexible approach described in MJAR-10 can be implemented.
          Jeremy Boynes made changes -
          Field Original Value New Value
          Link This issue is related to MJAR-10 [ MJAR-10 ]
          Jeremy Boynes created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Jeremy Boynes
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development