jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x JAR Plugin
  • MJAR-7

jar plugin recreates jar files all the time

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.1
  • Component/s: None
  • Labels:
    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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    maven-archiver-20060821.patch
    21/Aug/06 4:08 PM
    4 kB
    Jochen Wiedmann
  2. Text File
    maven-archiver-20060821-2.patch
    21/Aug/06 4:40 PM
    0.5 kB
    Jochen Wiedmann
  3. Text File
    maven-jar-plugin-20060821.patch
    21/Aug/06 4:40 PM
    0.9 kB
    Jochen Wiedmann
  4. Text File
    plexus-archiver-up2date.patch
    05/Jun/06 3:52 PM
    5 kB
    Jochen Wiedmann

Issue Links

depends upon

New Feature - A new feature of the product, which has yet to be developed. PLXCOMP-28 Archiver should check for up2date before recreating an archive

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is duplicated by

Improvement - An improvement or enhancement to an existing feature or task. MJAR-25 Do not rejar when not necessary

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MSOURCES-28 No test for up todate/no ablity to exclude pom.properties from resulting jar

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

New Feature - A new feature of the product, which has yet to be developed. MASSEMBLY-402 Assembly plugin goals should have a forceCreation parameter.

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Eric Andresen added a comment - 14/Dec/05 9:31 AM

I am most definitely interested in this suggestion; we have a 20-module project, which has at least 5 major projects (with wars and a jar apiece), and a lot of time is spent rebuilding these wars and jars, even if nothing has changed in them.

Show
Eric Andresen added a comment - 14/Dec/05 9:31 AM I am most definitely interested in this suggestion; we have a 20-module project, which has at least 5 major projects (with wars and a jar apiece), and a lot of time is spent rebuilding these wars and jars, even if nothing has changed in them.
Hide
Permalink
Jochen Wiedmann added a comment - 05/Jun/06 3:52 PM

Prerequisite patch for plexus-archiver.

Show
Jochen Wiedmann added a comment - 05/Jun/06 3:52 PM Prerequisite patch for plexus-archiver.
Hide
Permalink
Jochen Wiedmann added a comment - 15/Jun/06 10:52 AM

This issue supersedes the attached patch for the plexus-archiver.

Show
Jochen Wiedmann added a comment - 15/Jun/06 10:52 AM This issue supersedes the attached patch for the plexus-archiver.
Hide
Permalink
Richard Allen added a comment - 17/Aug/06 2:35 PM

Maven 2 has several great features, but the performance as compared to what you can get with Ant is quite disappointing. Because Maven 2 re-creates and re-installs artifacts (JAR, WAR, ZIP, whatever) even when no code or POM changes have been made, development multi-module builds are considerably slower than Ant, which does not recreate a JAR/WAR project if not necessary. This slows you down when you simply need to make a small change in one project of a multi-project build and re-build to test the change.

Show
Richard Allen added a comment - 17/Aug/06 2:35 PM Maven 2 has several great features, but the performance as compared to what you can get with Ant is quite disappointing. Because Maven 2 re-creates and re-installs artifacts (JAR, WAR, ZIP, whatever) even when no code or POM changes have been made, development multi-module builds are considerably slower than Ant, which does not recreate a JAR/WAR project if not necessary. This slows you down when you simply need to make a small change in one project of a multi-project build and re-build to test the change.
Hide
Permalink
Jochen Wiedmann added a comment - 21/Aug/06 4:08 PM

Suggested patch for the maven-archiver, depends on PLX-226.

Show
Jochen Wiedmann added a comment - 21/Aug/06 4:08 PM Suggested patch for the maven-archiver, depends on PLX-226.
Hide
Permalink
Jochen Wiedmann added a comment - 21/Aug/06 4:40 PM

Suggested patches to introduce a parameter "forced" into the maven-jar-plugin, which is configurable through a property "maven.build.forced".

Show
Jochen Wiedmann added a comment - 21/Aug/06 4:40 PM Suggested patches to introduce a parameter "forced" into the maven-jar-plugin, which is configurable through a property "maven.build.forced".
Hide
Permalink
Jason van Zyl added a comment - 21/Aug/06 7:18 PM

Patches applied, everything built and tested fine and we'll let others review before calling for a release.

Show
Jason van Zyl added a comment - 21/Aug/06 7:18 PM Patches applied, everything built and tested fine and we'll let others review before calling for a release.
Hide
Permalink
Andy DePue added a comment - 28/Feb/07 11:43 AM

It looks like this fix is scheduled for 2.1, but I'm curious if the fix addresses an issue I'm seeing? I'm currently using 2.0.5, and it looks like Maven is actually doing an "up to date" check between the .jar and the sources, but it always fails because pom.properties is a source file that gets included in the .jar, and since Maven always regenerates pom.properties with each build, it is always newer than the .jar. If I force maven NOT to include pom.properties in the resulting .jar, then Maven will actually work correctly: it won't rebuild the .jar until something changes. BTW, I'm turning off the inclusion of pom.properties via this config:

<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <addMavenDescriptor>false</addMavenDescriptor>
    </archive>
  </configuration>
</plugin>
Show
Andy DePue added a comment - 28/Feb/07 11:43 AM It looks like this fix is scheduled for 2.1, but I'm curious if the fix addresses an issue I'm seeing? I'm currently using 2.0.5, and it looks like Maven is actually doing an "up to date" check between the .jar and the sources, but it always fails because pom.properties is a source file that gets included in the .jar, and since Maven always regenerates pom.properties with each build, it is always newer than the .jar. If I force maven NOT to include pom.properties in the resulting .jar, then Maven will actually work correctly: it won't rebuild the .jar until something changes. BTW, I'm turning off the inclusion of pom.properties via this config:
<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <addMavenDescriptor>false</addMavenDescriptor>
    </archive>
  </configuration>
</plugin>

People

  • Assignee:
    Jason van Zyl
    Reporter:
    Jochen Wiedmann
Vote (3)
Watch (2)

Dates

  • Created:
    14/Dec/05 8:26 AM
    Updated:
    20/Apr/09 11:16 AM
    Resolved:
    21/Aug/06 7:18 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.