You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/09/21 13:54:14 UTC

[jira] Updated: (MAVEN-1431) plugins in MAVEN_HOME/plugins always updated in plugin cache after there last modified time changes

The following issue has been updated:

    Updater: Brett Porter (mailto:brett@codehaus.org)
       Date: Tue, 21 Sep 2004 7:52 AM
    Changes:
             assignee changed to Brett Porter
             Fix Version changed to 1.0.1
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/browse/MAVEN-1431?page=history

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MAVEN-1431

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-1431
    Summary: plugins in MAVEN_HOME/plugins always updated in plugin cache after there last modified time changes
       Type: Bug

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven
   Fix Fors:
             1.0.1
   Versions:
             1.0

   Assignee: Brett Porter
   Reporter: Mark Church

    Created: Mon, 30 Aug 2004 12:13 PM
    Updated: Tue, 21 Sep 2004 7:52 AM
Environment: Linux, J2SDK1.4.2_05, Maven 1.0

Description:
If the modification times of a plugin jar in MAVEN_HOME/plugins/[plugin name].jar is later than the modification time on the directory in ~/.maven/cache/[plugin name]/ then the jar is expanded on every build.

To demonstrate the problem do the following :

1) maven -X java:compile

On a new installation the following messages will be displayed :

Unpacking maven-nsis-plugin-1.1.jar to directory --> /tmp/maven-dev/cache/maven-nsis-plugin-1.1
expand complete

2) touch ${MAVEN_HOME}/plugins/*.jar

Touching the plugins simulates what would happen if say a new revision of a maven rpm where released.  While not actually changing the plugins the modification times would be updated.

3) maven -X java:compile

Again, as is expected the following message appears :

Unpacking maven-nsis-plugin-1.1.jar to directory --> /tmp/maven-dev/cache/maven-nsis-plugin-1.1
expand complete

4) maven -X java:compile

At this point the plugins should have all been expanded and be the most recent version but maven reports that it is still unpacking the plugins.  This causes uneeded delays in the build process.

It appears that maven is checking the last modified time on the directories in ~/.maven/cache/ however this time will not change unless the list of files in the directory are changed.

I don't believe this is the intended behaviour.  More than one solution comes to mind : 

* Set the last modified time on the destination directory in the Expander class after the plugin has been expanded.

* Delete the contents of the desitination directory before expanding the jar.  This is a little more involved to implement as we would need to implement a recursive delete function but it would probably be more correct as this would ensure that any files removed from the updated plugin would not continue to exist in the cache.

If I'm on the right track please let me know or point me in the right direction so I can supply a patch.


---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org