maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: Build error java.lang.IllegalArgumentException: Negative time, at java.io.File.setLastModified(File.java:1344)
Date Fri, 04 Oct 2013 11:27:51 GMT
Some related reports from 2011:

	https://jira.codehaus.org/browse/MJAR-142
	https://jira.codehaus.org/browse/MWAR-255

AFAICT the PlexusIoFileResource is effectively doing setLastModified(file.lastModified())
to 

	https://github.com/sonatype/plexus-io/blob/master/src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResource.java#L107

This JDK bug could be triggering the problem:

	http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6791812

In which case the PlexusIoFileResource code just needs to be more defensive and not trust
that lastModified returns a positive value...

On 3 Oct 2013, at 19:29, Ron Wheeler wrote:

> This is an error that I get when I execute my project in Eclipse/STS while running from
a RAM drive.
> If I run the same project running on Eclipse/STS while running on a regular disk drive
it works.
> 
> It is pretty deep in the Maven code and looks like Maven/Plexus sends a bad argument
to a Java function.
> 
> I have found another complaint like this by Googling but no one had any suggestion about
how to fix it.
> 
> My only fix is to stop using my high speed version and build it in my slow disk based
Eclipse and maven (Same software just not on a RAM drive).
> 
> I am intrigued by the idea that I am able to achieve some ability to reverse time but
it does not actually let me get more work done in a day. Quite the contrary.
> 
> Ron
> 
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single
(default) on project util-pom-hibernate-mysql-tomcat: Execution default of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single
failed: Negative time -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single
(default) on project util-pom-hibernate-mysql-tomcat: Execution default of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single
failed: Negative time
>    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
>    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:320)
>    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
>    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:57)
>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    at java.lang.reflect.Method.invoke(Method.java:601)
>    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.PluginExecutionException: Execution default of goal
org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed: Negative time
>    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
>    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:1344)
>    at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.setLastModified(PlexusIoFileResource.java:174)
>    at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.setFile(PlexusIoFileResource.java:107)
>    at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.<init>(PlexusIoFileResource.java:82)
>    at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.<init>(PlexusIoFileResource.java:66)
>    at org.codehaus.plexus.components.io.resources.PlexusIoFileResource.<init>(PlexusIoFileResource.java:49)
>    at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.addParentDirs(AbstractZipArchiver.java:446)
>    at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.addResources(AbstractZipArchiver.java:394)
>    at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:323)
>    at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:222)
>    at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:910)
>    at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
>    at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:186)
>    at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:436)
>    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
>    ... 20 more
> 
> -- 
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Mime
View raw message