You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ben Tatham (JIRA)" <ji...@codehaus.org> on 2009/04/24 18:28:45 UTC
[jira] Updated: (MSOURCES-44) If project doesn't contain sources
(contains only test sources) source:jar will fail
[ http://jira.codehaus.org/browse/MSOURCES-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ben Tatham updated MSOURCES-44:
-------------------------------
Attachment: failOnEmpty.patch
Here is a simple patch to provide a "failOnEmpty" parameter that can be set to false to skip ArchiverException. I could not see a simple way to check if no files are specified before calling the archiver, or to check that this is the reason for the ArchiverException. But it works for me.
Note: Must set attach=false to avoid trying to install/deploy a file that does not exist.
> If project doesn't contain sources (contains only test sources) source:jar will fail
> ------------------------------------------------------------------------------------
>
> Key: MSOURCES-44
> URL: http://jira.codehaus.org/browse/MSOURCES-44
> Project: Maven 2.x Source Plugin
> Issue Type: Bug
> Affects Versions: 2.1
> Environment: WinXp SP3, Cygwin
> Reporter: Bugittaa Pahasti
> Attachments: failOnEmpty.patch
>
>
> We are running all of our CI builds with the release profile so that javadocs and sources are generated. However, one module in a multi-module build contains only test sources. After updating from 2.0.4 to 2.1 the build will fail. The same error occurs when source:jar is run manually. Below is the stack trace from jar:source. It might be intentional that the build will fail in case source:jar is run from command line, but when using release profile the failure is quite problematic.
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error creating source archive: You must set at least one file.
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error creating source archive: You must set at least one file.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> 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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating source archive: You must set at least one file.
> at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:285)
> at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:232)
> at org.apache.maven.plugin.source.AbstractSourceJarMojo.execute(AbstractSourceJarMojo.java:201)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> ... 16 more
> Caused by: org.codehaus.plexus.archiver.ArchiverException: You must set at least one file.
> at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:260)
> at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:242)
> at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:673)
> at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:543)
> at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:277)
> ... 20 more
--
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