[
https://issues.apache.org/jira/browse/MSOURCES-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766685#comment-17766685
]
Hans Aikema commented on MSOURCES-141:
--------------------------------------
Ran into this issue as well, and in my view. I'm not knowingly using any build
cache, but run into this issue when putting to sequential lifecycle phases on a
CLI invocation (e.g. `mvn verify sonar:sonar deploy` in the practical build
pipeline usage to ensure that all binaries are available to run SonarQube
before deploying a new snapshot.
It's reproducible with a slightly modified version of the simple archetype
(only adding the source plugin and configuring its jar-no-fork execution (see
attached).
Working:
* mvn package
* mvn verify
Breaking:
* mvn package verify
> Check duplication of attached jar should be configurable to not fail when
> using the build cache
> -----------------------------------------------------------------------------------------------
>
> Key: MSOURCES-141
> URL: https://issues.apache.org/jira/browse/MSOURCES-141
> Project: Maven Source Plugin
> Issue Type: Bug
> Affects Versions: 3.3.0
> Reporter: Olivier Lamy
> Assignee: Olivier Lamy
> Priority: Major
> Fix For: 3.3.1
>
> Attachments: issue-msources-141.zip
>
>
> because https://issues.apache.org/jira/browse/MSOURCES-121 using source jar
> mojo and build cache generate an error as the cache restore a project with
> attached artifacts and so the source mojo fail because of this.
> {code}
> Caused by: org.apache.maven.plugin.MojoExecutionException: Presumably you
> have configured maven-source-plugn to execute twice times in your build. You
> have to configure a classifier for at least on of them.
> at org.apache.maven.plugins.source.AbstractSourceJarMojo.packageSources
> (AbstractSourceJarMojo.java:309)
> at org.apache.maven.plugins.source.AbstractSourceJarMojo.packageSources
> (AbstractSourceJarMojo.java:257)
> at org.apache.maven.plugins.source.AbstractSourceJarMojo.execute
> (AbstractSourceJarMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> (DefaultBuildPluginManager.java:126)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
> (MojoExecutor.java:328)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
> (MojoExecutor.java:316)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:174)
> at org.apache.maven.lifecycle.internal.MojoExecutor.access$000
> (MojoExecutor.java:75)
> at org.apache.maven.lifecycle.internal.MojoExecutor$1.run
> (MojoExecutor.java:162)
> at
> org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.restoreProject
> (BuildCacheMojosExecutionStrategy.java:224)
> at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute
> (BuildCacheMojosExecutionStrategy.java:131)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)