maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James William Dumay (JIRA)" <>
Subject [jira] Updated: (MSOURCES-44) If project doesn't contain sources (contains only test sources) source:jar will fail
Date Fri, 02 Oct 2009 01:28:57 GMT


James William Dumay updated MSOURCES-44:

    Attachment: MSOURCES-44.patch

Id suggest the following patch that simply checks that the archiver has files before it attempts
to create it. Having a configuration option for something that is clearly a regression is
probably not a good idea.

Maintainers can bug me for a functional test if they want one :)

> If project doesn't contain sources (contains only test sources) source:jar will fail
> ------------------------------------------------------------------------------------
>                 Key: MSOURCES-44
>                 URL:
>             Project: Maven 2.x Source Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: WinXp SP3, Cygwin
>            Reporter: Bugittaa Pahasti
>            Assignee: Arnaud Heritier
>            Priority: Blocker
>             Fix For: 2.1.1
>         Attachments: failOnEmpty.patch, MSOURCES-44.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.
> [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(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
>         at org.apache.maven.DefaultMaven.doExecute(
>         at org.apache.maven.DefaultMaven.execute(
>         at org.apache.maven.cli.MavenCli.main(
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.codehaus.classworlds.Launcher.launchEnhanced(
>         at org.codehaus.classworlds.Launcher.launch(
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(
>         at org.codehaus.classworlds.Launcher.main(
> 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(
>         at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources(
>         at org.apache.maven.plugin.source.AbstractSourceJarMojo.execute(
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
>         ... 16 more
> Caused by: org.codehaus.plexus.archiver.ArchiverException: You must set at least one
>         at
>         at
>         at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(
>         at org.apache.maven.archiver.MavenArchiver.createArchive(
>         at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources(
>         ... 20 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message