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

'Negative time' when trying to create an empty jar

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7
      maven 3.0.2

      Description

      When I try to run 'package' on a multi-module project one of the modules fails. The only difference on this module being it will run an ant script so no jar, or an empty one up until now, would be generated.

      Plugin 2.2 will do the job. Plugin 2.3 fails on '-X package' with:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on project ETRAMPackager: Error assembling JAR: Negative time -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on project ETRAMPackager: Error assembling JAR
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error assembling JAR
      	at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:223)
      	at org.apache.maven.plugin.jar.AbstractJarMojo.execute(AbstractJarMojo.java:235)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 19 more
      Caused by: java.lang.IllegalArgumentException: Negative time
      	at java.io.File.setLastModified(File.java:1258)
      	at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.setLastModified(PlexusIoFileResource.java:148)
      	at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.setFile(PlexusIoFileResource.java:82)
      	at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.<init>(PlexusIoFileResource.java:73)
      	at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.addResources(PlexusIoFileResourceCollection.java:144)
      	at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.getResources(PlexusIoFileResourceCollection.java:181)
      	at org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection.getLastModified(AbstractPlexusIoResourceCollection.java:247)
      	at org.codehaus.plexus.archiver.AbstractArchiver.isUptodate(AbstractArchiver.java:768)
      	at org.codehaus.plexus.archiver.AbstractArchiver.checkForced(AbstractArchiver.java:799)
      	at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:236)
      	at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:852)
      	at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:543)
      	at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:216)
      	... 22 more
      [ERROR] 
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      [ERROR] 
      [ERROR] After correcting the problems, you can resume the build with the command
      [ERROR]   mvn <goals> -rf :ETRAMPackager
      

        Attachments

          Activity

            People

            • Assignee:
              khmarbaise Karl Heinz Marbaise
              Reporter:
              bblasi bblasi bblasi
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: