You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andy DePue (JIRA)" <ji...@codehaus.org> on 2007/02/28 18:45:44 UTC

[jira] Commented: (MJAR-7) jar plugin recreates jar files all the time

    [ http://jira.codehaus.org/browse/MJAR-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_88834 ] 

Andy DePue commented on MJAR-7:
-------------------------------

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:
{code:xml}
<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <addMavenDescriptor>false</addMavenDescriptor>
    </archive>
  </configuration>
</plugin>
{code}

> jar plugin recreates jar files all the time
> -------------------------------------------
>
>                 Key: MJAR-7
>                 URL: http://jira.codehaus.org/browse/MJAR-7
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>            Reporter: Jochen Wiedmann
>         Assigned To: Jason van Zyl
>             Fix For: 2.1
>
>         Attachments: maven-archiver-20060821-2.patch, maven-archiver-20060821.patch, maven-jar-plugin-20060821.patch, plexus-archiver-up2date.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira