Uploaded image for project: 'Maven JAR Plugin'
  1. Maven JAR Plugin
  2. MJAR-7

jar plugin recreates jar files all the time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1
    • None
    • None

    Description

      The jar plugin doesn't seem to check, whether rebuilding a jar file is actually required. For daily work, it would be faster to do what Ant's "jar" task does: Compare the timestamps of the input files with the timestamp of the target file.

      While this approach has the obvious advantage of being safe (and thus possibly well choosen as a default), it is not appropriate for large projects, where a single build requires a real lot of jar files being rebuilt, even if only a single source file has been changed. This applies, in particular, because comparable plugins like the war, ear, and assembly plugin are forced to behave in the same manner.

      Suggestion:

      • Introduce a new property, for example "maven.build.force". The main idea of the property would
        be, that other plugins (install, war, assembly, ...) would listen to the same property. While they
        would possible ignore it initially, one could add support later on.
      • The default property value would be true.
      • If the property value is set to false, then the jar plugin compares the timestamps of the input files with
        the timestamp of the output file. If the latter is newer than the input timestamps, then the jar file isn't
        being rebuilt.

      I am ready to provide a patch, if my suggestion should find interest.

      Attachments

        1. maven-jar-plugin-20060821.patch
          0.9 kB
          Jochen Walz
        2. maven-archiver-20060821-2.patch
          0.5 kB
          Jochen Walz
        3. maven-archiver-20060821.patch
          4 kB
          Jochen Walz
        4. plexus-archiver-up2date.patch
          5 kB
          Jochen Walz

        Issue Links

          Activity

            People

              jvanzyl Jason van Zyl
              jochen.wiedmann@gmail.com Jochen Wiedmann
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: