Maven blocking on downloading jars (artifactId :tomcat-maven-plugin) - maven

i have a problem with tomcat-maven-plugin :
here's the code
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-beta-1</version>
</plugin>
so after running this command: clean tomcat:run
i get this result :
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building seleniumproject Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # seleniumproject ---
[INFO] Deleting C:\Users\Amira\junoWorkspace\seleniumproject\target
[INFO]
[INFO] >>> tomcat-maven-plugin:1.0-beta-1:run (default-cli) # seleniumproject >>>
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) #seleniumproject ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # seleniumproject ---
[INFO] No sources to compile
[INFO]
[INFO] <<< tomcat-maven-plugin:1.0-beta-1:run (default-cli) # seleniumproject <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.0-beta-1:run (default-cli) # seleniumproject ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin- api/2.0/maven-plugin-api-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom (601 B at 1.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/junit/junit/3.8.2/junit-3.8.2.pom
.......................................
Downloaded: http://repo.maven.apache.org/maven2/org/apache/tomcat/dbcp/6.0.16/dbcp-6.0.16.jar (194 KB at 128.6 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/tomcat/coyote/6.0.16/coyote-6.0.16.jar (725 KB at 367.5 KB/sec)
As you see it blocks on downloading :
Is there a solution please

I don't know where you get the url from:
http://repo.maven.apache.org/maven2/
but it looks you have changed the configuration in the settings.xml file, cause Maven Central has http://repo1.maven.apache.org/maven2/ instead. Furthermore i can recommend to use a repository manager (Nexus, Archiva, Artifactory).
BTW: Why are you using the mojo.codehaus tomcat plugin and not the offical of Apache http://tomcat.apache.org/maven-plugin.html

Related

Problem getting maven plugin from jfrog artifactory

I'm trying to get an old maven project connected to private artifactory to download plugins when building. I'm sitting in a coporate network (using vpn), using a jfrog artifactory.
"mvn clean install -U" returns:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ProjektYXZ - parent POM [pom]
[INFO] ProjektYXZ - main POM [pom]
[INFO]
[INFO] ---------------------< com.*:mvn-project >----------------------
[INFO] Building ProjektYXZ - parent POM 1.14.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # mvn-project ---
[INFO] Deleting **mvn-project\target
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources # mvn-project >>>
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources # mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) # mvn-project ---
[INFO]
[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) # mvn-project ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-checkstyle-plugin:3.0.0:check (default) # mvn-project ---
[INFO]
[INFO] >>> spotbugs-maven-plugin:3.1.11:check (default) > :spotbugs # mvn-project >>>
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:spotbugs (spotbugs) # mvn-project ---
[INFO]
[INFO] <<< spotbugs-maven-plugin:3.1.11:check (default) < :spotbugs # mvn-project <<<
[INFO]
[INFO]
[INFO] --- spotbugs-maven-plugin:3.1.11:check (default) # mvn-project ---
[INFO]
[INFO] >>> maven-pmd-plugin:3.11.0:check (default) > :pmd # mvn-project >>>
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:pmd (pmd) # mvn-project ---
[INFO]
[INFO] <<< maven-pmd-plugin:3.11.0:check (default) < :pmd # mvn-project <<<
[INFO]
[INFO]
[INFO] --- maven-pmd-plugin:3.11.0:check (default) # mvn-project ---
[INFO]
[INFO] --- plugin:1.4.1:enforce (default) # mvn-project ---
Downloading from central-mirror: https://artifactory.*.de/artifactory/maven/**/*-1.0.2.pom
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
[WARNING] The POM for com.**:jar:1.0.2 is missing, no dependency information available
Downloading from central-mirror: https://artifactory.**.de/artifactory/maven/**/*-1.0.2.jar
Downloading from company-releases: https://artifactory.**.de/artifactory/**/*-1.0.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ProjektYXZ - main POM 1.14.0-SNAPSHOT:
[INFO]
[INFO] ProjektYXZ - parent POM .................................. FAILURE [ 7.645 s]
[INFO] ProjektYXZ - main POM .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.826 s
[INFO] Finished at: 2022-04-12T10:18:02+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:plugin:1.4.1:enforce (default) on project mvn-project: Execution default of goal org.apache.maven.plugins:plugin:1.4.1:enforce failed: Plugin org.apache.maven.plugins:plugin:1.4.1 or one of its dependencies could not be resolved: Could not find artifact com.**:jar:1.0.2 in central-mirror (https://artifactory.**.de/artifactory/maven) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
in the line:
Downloading from company-releases: https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom
maven looks at the correct place. I'm able to download it with curl:
curl -u username:password -X GET "https://artifactory.**.de/artifactory/**/1.0.2/*-1.0.2.pom"
but if I paste that path into Chrome, I get an 404 Error.
I also configured the settings.xml in my C:/Users/Username/.m2/ folder:
<server>
<id>company-releases</id>
<username>my_username</username>
<password>my_password</password>
</server>
I also checked the possible errors of the Link shown at the bottom of the log, but as I'm able to "curl" it these don't seem to be the reasons. Currently I'm out of ideas. I hope you can help me :) Please tell me if you need to see additional sources.
okay, the solution was to set preemptive authentification in settings.xml:
for example:
<server>
<username>*****</username>
<password>*****</password>
<id>central</id>
<configuration>
<httpConfiguration>
<all>
<usePreemptive>true</usePreemptive>
</all>
</httpConfiguration>
</configuration>
</server>
Explanation: maven first tries to request without authentification. If the Repo is private (this means that without authentification, artifacts are hidden), jfrog artifactory responses with 404 instead of unauthenticated. After 404 maven doesn't try again, but sees it as failed.
For more details see: https://jfrog.com/knowledge-base/why-does-my-maven-builds-are-failing-with-a-404-error-when-hide-existence-of-unauthorized-resources-is-enabled/

Maven surefire plugin doesn't run our Unit test case

Apache Maven 3.5.2 - the pom.xml doesn't declare the surefire plugin explicitly, but the effective pom.xml shows 2.18.1
When I run 'mvn test' - it ends successfully, it doesn't say that it can't find any test cases, but there is no trace of the test cases. This is all I see:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpreadSheetUploadWeb 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.fasterxml.jackson.core:jackson-databind:jar:1.9.10 is missing, no dependency information available
[WARNING] The POM for com.fasterxml.jackson.core:jackson-annotations:jar:1.9.10 is missing, no dependency information available
[WARNING] The POM for com.fasterxml.jackson.core:jackson-core:jar:1.9.10 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SpreadSheetUploadWeb ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 22 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SpreadSheetUploadWeb ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SpreadSheetUploadWeb ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # SpreadSheetUploadWeb ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # SpreadSheetUploadWeb ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
My pom.xml has jar specified, and my test case is in:
c:/SpreadSheetUploadWeb/src/test/java/com/ibm/cio/cloud/cost/spreadsheet/dao/UnitTestJdbcCostSpreadsheetDAO.java
It works perfectly when I run test explicitly like this:
mvn surefire:test -Dtest=UnitTestJdbcCostSpreadsheetDAO.java
Why won't it run when I just run: mvn test ?
By default surefire search for files following this patterns:
**/Test*.java
**/*Test.java
**/*Tests.java
**/*TestCase.java
http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html

Maven don't execute junit test

I'm trying to test this project: https://github.com/deglans/jenktest
but maven say that:
$ mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jenktest
[INFO] hello
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jenktest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # jenktest ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # jenktest ---
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/pom.xml to /home/deglans/.m2/repository/io/github/deglans/jenktest/0.0.1-SNAPSHOT/jenktest-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hello 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hello ---
[INFO] Deleting /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /documenti/deglans/Programs/IdeaProjects/jenktest/hello/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # hello ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # hello ---
[INFO] Building jar: /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/hello-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # hello ---
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/hello-0.0.1-SNAPSHOT.jar to /home/deglans/.m2/repository/io/github/deglans/hello/0.0.1-SNAPSHOT/hello-0.0.1-SNAPSHOT.jar
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/hello/pom.xml to /home/deglans/.m2/repository/io/github/deglans/hello/0.0.1-SNAPSHOT/hello-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] jenktest ........................................... SUCCESS [ 0.449 s]
[INFO] hello .............................................. SUCCESS [ 1.715 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.360 s
[INFO] Finished at: 2017-12-16T11:41:59+01:00
[INFO] Final Memory: 14M/48M
[INFO] ------------------------------------------------------------------------
What is the warning and why maven completely skip the test phase?
The final purpose of this work is to test email jenkins feature, but for now I'm blocked by this problem...
Thanks
Summary
You need to either rename GreetingTests.java to GreetingTest.java, or update your maven-surefire-plugin. Updating surefire plugin can provide better pattern for inclusions of tests. You can declare it in project's parent POM ./pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- ... -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Detail
What is the warning and why maven completely skip the test phase?
Maven didn't skip the test phase. Maven unit tests are executed by maven-surefire-plugin, and it has been triggered correctly:
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # hello ---
You need to rename your test to GreetingTests.java to GreetingTest.java. Because the surefire-plugin:2.12.4 does not recognize pattern *Tests.java, as documented here:
By default, the plugin will automatically include all test classes with the following wildcard patterns:
"**/Test*.java" - includes all of its subdirectories and all java
filenames that start with "Test".
"**/*Test.java" - includes all of its subdirectories and all java
filenames that end with "Test".
"**/*TestCase.java" - includes all of its subdirectories and all java
filenames that end with "TestCase".

Maven Deploy Command

Here I just tried to deploy my simple maven project to git hub.I added some more plugins for deploying.I can compile,and package that.While deploying still i'm facing some errors.Please help me to resolve this.Can you give any idea for deploy a maven project from eclipse.
C:\MavApp\MavDep>mvn clean deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MavDep 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # MavDep ---
[INFO] Deleting C:\MavApp\MavDep\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # MavDep ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\MavApp\MavDep\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # MavDep ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\MavApp\MavDep\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # MavDep ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\MavApp\MavDep\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # MavDep ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\MavApp\MavDep\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # MavDep ---
[INFO] Surefire report directory: C:\MavApp\MavDep\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.MavDep.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # MavDep ---
[INFO] Building jar: C:\MavApp\MavDep\target\MavDep-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # MavDep ---
[INFO] Installing C:\MavApp\MavDep\target\MavDep-1.0-SNAPSHOT.jar to C:\Users\mstemp 401\.m2\repository\com\MavDep\MavDep\1.0-SNAPSHOT\MavDep-1.0-SNAPSHOT.jar
[INFO] Installing C:\MavApp\MavDep\pom.xml to C:\Users\mstemp 401\.m2\repository\com\MavDep\MavDep\1.0-SNAPSHOT\MavDep-1.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # MavDep ---
Downloading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/maven-metadata.xml
Uploading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/MavDep-1.0-20170412.080139-1.jar
Uploaded: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/MavDep-1.0-20170412.080139-1.jar (3 KB at 78.8 KB/sec)
Uploading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/MavDep-1.0-20170412.080139-1.pom
Uploaded: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/MavDep-1.0-20170412.080139-1.pom (2 KB at 121.9 KB/sec)
Downloading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/maven-metadata.xml
Uploading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/maven-metadata.xml
Uploaded: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/1.0-SNAPSHOT/maven-metadata.xml (760 B at 23.2 KB/sec)
Uploading: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/maven-metadata.xml
Uploaded: file://C:\MavApp\MavDep\target/mvn-repo/com/MavDep/MavDep/maven-metadata.xml (274 B at 17.8 KB/sec)
[INFO]
[INFO] --- site-maven-plugin:0.11:site (default) # MavDep ---
[INFO] Creating 12 blobs
[INFO] Creating tree with 12 blob entries
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.161 s
[INFO] Finished at: 2017-04-12T13:31:51+05:30
[INFO] Final Memory: 19M/160M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.11:site (default) on project MavDep: Error creating commit: Invalid request.
[ERROR]
[ERROR] For 'properties/name', nil is not a string.
[ERROR] For 'properties/name', nil is not a string. (422)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It seems that in your maven properties the name is incorrect. Check your pom.xml file.
If this is not the case, try running it with the -e switch on

maven deploy + nexus failed on bad request

I am experiencing some problems with my build process.
the build is finishing fine and Jenkins starts to upload files to nexus. everything works well, but then it fails for some reason, the weirdest part is that the file that is mentioned to not be uploaded is actually uploaded and i can find it in nexus.
here is the output:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] pn-parent
[INFO] pn-domain
[INFO] pn-infra
[INFO] pn-config
[INFO] datalink-repository
[INFO] pn-service
[INFO] pn-backend
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pn-parent 0.0.707
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact junit:junit-dep:pom:4.11 has been relocated to junit:junit:pom:4.11
[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-cli) # pn-parent ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /var/lib/jenkins/jobs/webapps-server-side-release/workspace/pn-parent/target/pn-parent-0.0.707.jar
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-cli) # pn-parent ---
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/0.0.707/pn-parent-0.0.707.pom
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/0.0.707/pn-parent-0.0.707.pom (15 KB at 111.6 KB/sec)
Downloading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/maven-metadata.xml
Downloaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/maven-metadata.xml (21 KB at 1036.9 KB/sec)
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/maven-metadata.xml
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-parent/maven-metadata.xml (21 KB at 864.7 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pn-domain 0.0.707
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact junit:junit-dep:pom:4.11 has been relocated to junit:junit:pom:4.11
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-cli) # pn-domain ---
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-cli) # pn-domain ---
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-domain/0.0.707/pn-domain-0.0.707.jar
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/0.0.707/datalink-repository-0.0.707.jar (624 KB at 7606.1 KB/sec)
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/0.0.707/datalink-repository-0.0.707.pom
2/4 KB
4/4 KB
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/0.0.707/datalink-repository-0.0.707.pom (4 KB at 93.0 KB/sec)
Downloading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/maven-metadata.xml
Downloaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/maven-metadata.xml (21 KB at 1382.8 KB/sec)
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/maven-metadata.xml
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/datalink-repository/maven-metadata.xml (21 KB at 1037.8 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pn-service 0.0.707
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact junit:junit-dep:pom:4.11 has been relocated to junit:junit:pom:4.11
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-cli) # pn-service ---
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-cli) # pn-service ---
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn-service/0.0.707/pn-service-0.0.707.jar
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.war (1247 KB at 19480.3 KB/sec)
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.pom
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.pom (11 KB at 376.2 KB/sec)
Downloading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/maven-metadata.xml
Downloaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/maven-metadata.xml (21 KB at 1213.1 KB/sec)
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/maven-metadata.xml
Uploaded: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/maven-metadata.xml (21 KB at 1031.7 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] pn-parent ................................... SUCCESS [ 1.081 s]
[INFO] pn-domain ................................... SUCCESS [ 0.696 s]
[INFO] pn-infra .................................... SUCCESS [ 0.295 s]
[INFO] pn-config ................................... SUCCESS [ 0.275 s]
[INFO] datalink-repository ............................... SUCCESS [ 0.390 s]
[INFO] pn-service .................................. SUCCESS [ 0.475 s]
[INFO] pn-backend .................................. SUCCESS [ 1.043 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.234 s
[INFO] Finished at: 2014-07-17T14:31:30+00:00
[INFO] Final Memory: 19M/206M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "release" could not be activated because it does not exist.
using global settings config with name mycompany-global-dev-maven-settings
[workspace] $ /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven-3.1.1/bin/mvn -gs /tmp/global-settings8833627416958413984.xml deploy:deploy-file -Durl=http://maven.mycompany.com:8081/nexus/content/repositories/releases/ -DrepositoryId=mycompany.repository -DpomFile=pn-parent/Backend/pom.xml -Dfile=pn-parent/Backend/target/pn-backend.war
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] 'usePluginRegistry' is deprecated and has no effect. # /var/lib/jenkins/.m2/settings.xml
[WARNING]
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) # standalone-pom ---
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.war
...
Uploading: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.pom
2/11 KB
4/11 KB
6/11 KB
8/11 KB
10/11 KB
11/11 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.928 s
[INFO] Finished at: 2014-07-17T14:31:33+00:00
[INFO] Final Memory: 6M/142M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.mycompany.pn:pn-backend:war:0.0.707 from/to mycompany.repository (http://maven.mycompany.com:8081/nexus/content/repositories/releases/): Failed to transfer file: http://maven.mycompany.com:8081/nexus/content/repositories/releases/com/mycompany/pn/pn-backend/0.0.707/pn-backend-0.0.707.war. Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Conditional steps (multiple)' marked build as failure
[locks-and-latches] Releasing all the locks
[locks-and-latches] All the locks released
[Current build status] check if current [FAILURE] is worse or equals then [SUCCESS] and better or equals then [SUCCESS]
Run condition [Current build status] preventing perform for step [Record JaCoCo coverage report]
Description set:
Start to submit Nexus scheduled tasks.
Submitting... [id: 36, name: release-build, type: Rebuild Maven Metadata Files]
End to submit Nexus scheduled tasks successfully.
Notifying upstream projects of job completion
Finished: FAILURE
A colleague of mine just ran into the same problem with maven attempting to upload artifacts twice.
We found some help in the forums, links included below.
Bae's answer did the trick for us:
Try running mvn -Prelease-profile help:effective-pom. You will find
that you have two execution sections for maven-source-plugin
[...]
To fix this problem, find everywhere you have used
maven-sources-plugin and make sure that you use the "id"
attach-sources so that it is the same as the release profile. Then
these sections will be merged. Best practice says that to get
consistency you need to configure this in the root pom of your project
in build > pluginManagement and NOT in your child poms. In the child
pom you just specify in build > plugins that you want to use
maven-source-plugin but you provide no executions.
Nexus accepts upload but says it failed and Maven release plugin fails : source artifacts getting deployed twice
snapshot and release confliction also results in 400 bad request. The project you are trying to update may be a snapshot like this in pom:
<version>0.0.1-SNAPSHOT</version>
while the repository in settings.xml rejects snapshot. solution:
<version>0.0.1</version>
This also happens the other way round: trying to deploy a release (version has no snapshot) version to a snapshot repository.
I also came across this problem. In my case I'd configured the Nexus repository policy to accept release artefacts but I was actually pushing a snapshot artefact to the repo. Since I wanted a snapshot repo I simply changed the policy and all was well.
This happened to me as well. In my case, I was deploying a release version. To fix, make sure the version number doesn't exist in Nexus yet. If it's a multi-module project, check the sub-modules' versions as well.

Resources