Error while storing artifacts to Nexus through Jenkins - maven

I was trying to store artifacts to Nexus.
When trying using the Command line using mvn clean package deploy the Build Sucess and Artifacts are stored in the desired Nexus repository.
Now trying the same code With Jenkins with Goals and Option clean package deploy till package it is done successfully and after that, it shows error
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) # maven-webapp ---
[INFO] Downloading from deployment: http://localhost:8081/repository/sample-snap/com/infy/demos/maven-webapp/0.0.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.infy.demos:maven-webapp:0.0.1-SNAPSHOT/maven-metadata.xml from/to deployment (http://localhost:8081/repository/sample-snap/): Not authorized
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.173 s
[INFO] Finished at: 2019-11-25T12:22:12+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project maven-webapp: Failed to retrieve remote metadata com.infy.demos:maven-webapp:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.infy.demos:maven-webapp:0.0.1-SNAPSHOT/maven-metadata.xml from/to deployment (http://localhost:8081/repository/sample-snap/): Not authorized -> [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
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\maven-demo\pom.xml to com.infy.demos/maven-webapp/0.0.1-SNAPSHOT/maven-webapp-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\maven-demo\target\maven-webapp.war to com.infy.demos/maven-webapp/0.0.1-SNAPSHOT/maven-webapp-0.0.1-SNAPSHOT.war
channel stopped
Finished: FAILURE
Already configure Nexus Repository Manager Servers in the Jenkins and tested the connection showing Nexus Repository Manager 3.x connection succeeded.
Using Nexus OSS 3.19.1-01.

Related

Jenkins Maven integration failed

I am trying to integrate Jenkins with Maven. Through terminal I am able to execute the Maven command (clean install). But from Jenkins it fails.
Getting following error:
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BrowserStackDemo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # BrowserStackDemo ---
[INFO] Deleting /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.090 s
[INFO] Finished at: 2018-02-04T16:17:27+01:00
[INFO] Final Memory: 11M/190M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
[ERROR]
[JENKINS] Archiving /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml to BrowserStack/BrowserStackDemo/0.0.1-SNAPSHOT/BrowserStackDemo-0.0.1-SNAPSHOT.pom
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml is not inside /Users/Shared/Jenkins/Home/workspace/MavenJenkinsIntegration1/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/; will archive in a separate pass
[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
channel stopped
Finished: FAILURE
Note:
I am not using any server like Tomcat. My problem is not able to delete the target folder from Jenkins, when ever I taken a clean build, target folder will create newly, so I am unable to give the access for the target folder.
Your Jenkins executor is unable to delete the target folder of project . The error statements points it out clearly.
*[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
Such error occurs when the access to file is denied at the OS filesystem level OR the target folder's files are already being used somewhere in some other process and they are left in OPEN state. Try deleting the target folder manually.

Jenkins svn branches

I recently created an automated process to run multi-step Maven builds for my organization. But i am having difficulty committing the version changes on svn
I want to update this file contents and compile my code and then commit this file back to svn. So that SVN has latest build version number.
How do I commit this changed file to SVN.
Ty very much.
I invoke top-level Maven targets to release in svn:
my goals is: release:perform -DconnectionUrl=scm:svn:http://XXX
This is my maven error in jenkins:
[maven] $ cmd.exe /C "D:\apache-maven-3.5.0\bin\mvn.cmd release:perform -DconnectionUrl=scm:svn:http://10.10.20.151/svn/repos/aubay/test/jenkins/branches && exit %%ERRORLEVEL%%"
channel stopped
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jenkins 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.3.2:perform (default-cli) # jenkins ---
[ERROR] Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.199 s
[INFO] Finished at: 2017-08-24T15:48:29+02:00
[INFO] Final Memory: 12M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:perform (default-cli) on project jenkins: Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag. -> [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/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

Maven build failing with Connection timed out

So I'm setting up a jenkins instance and have a maven project from git configured.
When I try to build I have an option set to do a "clean package" but im getting the following error in Jenkins logs: Is there a Jenkins setting Im missing?
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean- plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2016-06-20T19:11:04-04:00
[INFO] Final Memory: 15M/294M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.32.215] failed: Connection timed out -> [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

dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

I am getting below error when i am doing build project ..
in jenkins i have given git url to fetch the code ..and its getting the code but after few steps execution in jenkins console its showing below error
Parsing POMs
[ushell-selenium-tests] $ /usr/java/jdk1.7.0_79/bin/java -cp /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/usr/maven/apache-maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/usr/maven/apache-maven-3.3.3/conf/logging jenkins.maven3.agent.Maven31Main /usr/maven/apache-maven-3.3.3 /usr/apache/apache-tomcat-8.0.24/webapps/jenkins/WEB-INF/lib/remoting-2.52.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 46554
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /root/.jenkins/jobs/Project 32 test ushell 1 fb_search_app selenium/workspace/ushell-selenium-tests/pom.xml install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sap.ushell:ushell-selenium-tests:jar:1.33.0-SNAPSHOT
[WARNING] 'dependencies.dependency.scope' for org.testng:testng:jar must be one of [provided, compile, runtime, test, system] but is 'integration-test'. # line 63, column 10
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ushell-selenium-tests 1.33.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.988 s
[INFO] Finished at: 2015-10-01T16:24:45+02:00
[INFO] Final Memory: 15M/608M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [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
[JENKINS] Archiving /root/.jenkins/jobs/Project 32 test ushell 1 fb_search_app selenium/workspace/ushell-selenium-tests/pom.xml to com.sap.ushell/ushell-selenium-tests/1.33.0-SNAPSHOT/ushell-selenium-tests-1.33.0-SNAPSHOT.pom
/root/.jenkins/jobs/Project 32 test ushell 1 fb_search_app selenium/workspace/ushell-selenium-tests/pom.xml is not inside /root/.jenkins/jobs/Project 32 test ushell 1 fb_search_app selenium/workspace/root/.jenkins/jobs/Project 32 test ushell 1 fb_search_app selenium/workspace/ushell-selenium-tests/; will archive in a separate pass
channel stopped
Finished: FAILURE
I was able to resolve the "Unknown host repo.maven.apache.org: Name or service not known" error by using another internet connection. The first one had a proxy in place which did not allow to download anything from the repo.

How to resolve BUILD FAILURE project tutorial DevKit mulesoft

I'm trying to use for the first time DevKit of mulesoft, I'm following the guide of mulesoft at link: http://www.mulesoft.org/documentation/display/current/Tutorial+-+Barn+Connector. I have installed DevKit Plugin from Mule studio and after that I have tried to create the Anypoint Connector Project like the guide said me, but I have found the problem with Maven.
My error is:
[INFO] Downloading: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloading: http://snapshots.repository.codehaus.org/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloading: http://repository.mulesoft.org/snapshots/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-jar-plugin/maven-metadata.xml from/to codehaus-plugin-snapshots (http://snapshots.repository.codehaus.org): Connect to http-proxy.xxx.com:80 [http-proxy.xxx.com/xxx] failed: Connection timed out: connect
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-jar-plugin/maven-metadata.xml from/to mulesoft-plugin-releases (http://repository.mulesoft.org/releases/): Connect to http-proxy.xxx.com:80 [http-proxy.xxx.com/xxx] failed: Connection timed out: connect
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-jar-plugin/maven-metadata.xml from/to mulesoft-plugin-snapshots (http://repository.mulesoft.org/snapshots/): Connect to http-proxy.xxx.com:80 [http-proxy.xxx.com/xxx] failed: Connection timed out: connect
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-jar-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): Connect to http-proxy.xxx.com:80 [http-proxy.xxx.com/xxx] failed: Connection timed out: connect
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:27 min
[INFO] Finished at: 2015-03-11T13:05:19+01:00
[INFO] Final Memory: 16M/223M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-jar-plugin' from the repositories [local (C:\Users\s\.m2\repository), codehaus-plugin-snapshots (http://snapshots.repository.codehaus.org), mulesoft-plugin-releases (http://repository.mulesoft.org/releases/), mulesoft-plugin-snapshots (http://repository.mulesoft.org/snapshots/), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException
How to resolve it?
Seems like something happened when maven was downloading the dependencies, try generating another new connector.
Did you check for the existence of Maven JAR with the specified version?

Resources