Hi,
The issue looks a bit like:
https://issues.apache.org/jira/browse/MNG-5359
On 03/07/18 21:04, Karl Heinz Marbaise wrote:
Hi Jim,
first thanks for the example project which helps a lot to find the real
problem...
So the issue is related to two things. First you have defined your own a
release profile which is ok so far...
The problem is related to the definition of the maven-sources-plugin
like this:
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
which in result means the maven-source-plugin will be executed
twice...which looks like this:
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @
hello-world-not-using-corp-parent-war ---
[INFO] Building jar:
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) >
generate-sources @ hello-world-not-using-corp-parent-war >>>
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) <
generate-sources @ hello-world-not-using-corp-parent-war <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @
hello-world-not-using-corp-parent-war ---
[INFO]
[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @
hello-world-not-using-corp-parent-war ---
[INFO] Skipping javadoc generation
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @
hello-world-not-using-corp-parent-war ---
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.war
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.war
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/pom.xml
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.pom
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
If you do a "mvn clean install" it will not cause a problem cause the
created sources.jar will be overwritten...but if you do a mvn clean
deploy nexus will prevent the upload of the second sources jar ....which
result in the error you have described....
So the solution:
The maven-source-plugin is already defined in the super pom of maven and
if you simply omit the definition this will work:
[INFO] --- maven-war-plugin:2.2:war (default-war) @
hello-world-not-using-corp-parent-war ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hello-world-not-using-corp-parent-war] in
[/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources
[/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/src/main/webapp]
[INFO] Webapp assembled in [24 msecs]
[INFO] Building war:
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @
hello-world-not-using-corp-parent-war ---
[INFO] Building jar:
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @
hello-world-not-using-corp-parent-war ---
[INFO] Skipping javadoc generation
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @
hello-world-not-using-corp-parent-war ---
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.war
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.war
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/pom.xml
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT.pom
[INFO] Installing
/Users/kama/ws-git-maven-bugs/MNG-duplicate-files/hello-world-not-using-corp-parent/hello-world-not-using-corp-parent-war/target/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
to
/Users/kama/.m2/repository/com/github/sellersj/no/corp/parent/hello-world-not-using-corp-parent-war/0.0.5-SNAPSHOT/hello-world-not-using-corp-parent-war-0.0.5-SNAPSHOT-sources.jar
[INFO]
Than a deploy should also work without any issue...
If you like to pin the version of the plugin you can simply do that by
defining it like this:
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>
without the execution block...which should not influence it but does
which needs a more deep analysis...and looks like a bug...
Kind regards
Karl Heinz Marbaise
On 03/07/18 18:33, Jim Sellers wrote:
Hi Karl.
I've created a minimal project. The git and nexus / repo info would
have to be set in a settings.xml file, and the nexus repo would have
to not allow overwriting releases.
https://github.com/sellersj/hello-world-not-using-corp-parent
This works for maven 3.5.3 but not 3.5.4
If you need a log, I'll have to scrub it and that will take me more time.
Thanks so much for your help.
Jim
On Sat, Jun 30, 2018 at 6:11 AM Jim Sellers <jim.sell...@gmail.com
<mailto:jim.sell...@gmail.com>> wrote:
I’ll create one next week.
Thanks for your help.
Jim
On Sat, Jun 30, 2018 at 2:43 AM Karl Heinz Marbaise
<khmarba...@gmx.de <mailto:khmarba...@gmx.de>> wrote:
Hi Jim,
On 29/06/18 21:15, Jim Sellers wrote:
> Hi all.
>
> We have nexus reject over writing releases.
>
> After upgrading maven from 3.5.3 to 3.5.4, the release plan
tries to upload
> the -sources jars twice, failing the build.
>
> This is for a multi module project.
> pom
> \- ear
> \- war
>
> Example error message
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
(default-deploy)
> on project TestProjectWAR: Failed to deploy artifacts: Could
not transfer
> artifact ca.gc.ic.test:TestProjectWAR:jar:sources:1.6.0
from/to
> internal-nexus (
>
https://my-nexus.example.com/maven-proxy/content/repositories/internal-released):
> Failed to transfer file:
>
https://my-nexus.example.com/maven-proxy/content/repositories/internal-released/com/example/TestProjectWAR/1.6.0/TestProjectWAR-1.6.0-sources.jar.
> Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]
>
> Revering maven to 3.5.3 fixes it. Anyone else seeing this
behaviour?
Do you have a sample project which reproduces the issue (github /
bitbucket / gitlab) and very important the whole pom
files....also a log
file would be helpful...
Kind regards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org