Jenkins Maven integration failed - maven

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.

Related

what is the cause of this openliberty docker error

Just following Product documentation instructions:
Please see Error log message.
Not sure what the error is and how to fix it.
mvn liberty:devc
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< io.openliberty.guides:guide-getting-started >-------------
[INFO] Building guide-getting-started 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- liberty-maven-plugin:3.3.4:devc (default-cli) # guide-getting-started ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty- kernel:null:21.0.0.3:zip.
[INFO] CWWKM2102I: Using installDirectory : /home/zahid/Liberty-eclipse/guide-getting-started/start/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /home/zahid/Liberty-eclipse/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Running maven-compiler-plugin:compile
[INFO] Copying 1 file to /home/zahid/Liberty-eclipse/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /home/zahid/Liberty-eclipse/guide-getting-started/start/src/main/liberty/config/server.xml.
[INFO] Building Docker image...
[INFO] docker build --pull -f /tmp/tempDockerfile17415566016391532686 -t guide-getting-started-dev-mode /home/zahid/Liberty-eclipse/guide-getting-started/start
[ERROR] unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /tmp/tempDockerfile17415566016391532686: no such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.343 s
[INFO] Finished at: 2021-03-20T16:28:39Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.3.4:devc (default-cli) on project guide-getting-started: Could not build Docker image using Dockerfile: /home/zahid/Liberty-eclipse/guide-getting-started/start/Dockerfile. Address the following docker build error and then start dev mode again: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /tmp/tempDockerfile17415566016391532686: no such file or directory RC=1 -> [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
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat
Resolution: Remove the snappy version from Ubuntu 20.04
$ sudo snap remove docker
then install using these instructions
https://docs.docker.com/engine/install/ubuntu/#uninstall-docker-engine
Problem: Snappy installation of docker was broken.

I can't create .war with maven

I created a .war with maven clean install, now I need create other .war, but I get this error ->
- maven-clean-plugin:2.6.1:clean (default-clean) # tutorial---
[INFO] Deleting C:\Users\yo\eclipse-workspace\tutorial\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.843 s
[INFO] Finished at: 2018-09-24T15:46:51+02:00
[INFO] Final Memory: 17M/228M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean (default-clean) on project tutorial: Failed to clean project: Failed to delete C:\Users\yo\eclipse-workspace\tutorial\target -> [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
Now My field \target is empty and I can't create .war
Some other application has opened the target folder. Due to this maven-clean-plugin is not able to delete the target folder and fails.

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

Allow Maven to automatically create directories in Ubuntu

I am running Maven 3.0.4 in Ubuntu 12.04. I have Java version 1.7.0_25. I am trying to use the mvn package command, but am continually running into errors, which are always along the lines of:
Failure executing javac, but could not parse the error:
javac: directory not found: /......../target/[some folder]
I couldn't figure out what this was originally but now understand from some basic googling that this is because the destination directory has to exist. The generally suggested way to handle this problem is to create an ant script which does it for you (I think).
However, I have no idea what folders actually need to be created. This is not my project I'm compiling, just something I've downloaded. Can an Ant script still be used and, if so, could anybody point me in the right direction as I have never used an ant script before, much less created one, and could quite accurately be called a Ubuntu "noob"!
Full Maven output as requested
Directory is:
flume-sources - containing
flume.conf
pom.xml
src
main
java
com
cloudera
flume
source
TwitterSource.java
TwitterSourceConstants.java
Maven error is:
andrew#andrew-VirtualBox:~/flume-sources$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building flume-sources 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # flume-sources ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/andrew/flume-sources/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # flume-sources ---
[INFO] Compiling 2 source files to /home/andrew/flume-sources/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
javac: directory not found: /home/andrew/flume-sources/target/classes
Usage: javac <options> <source files>
use -help for a list of possible options
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.470s
[INFO] Finished at: Mon Jul 08 12:35:58 BST 2013
[INFO] Final Memory: 9M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project flume-sources: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] javac: directory not found: /home/andrew/flume-sources/target/classes
[ERROR] Usage: javac <options> <source files>
[ERROR] use -help for a list of possible options
[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/MojoFailureException
andrew#andrew-VirtualBox:~/flume-sources$
No, you don't need to create the folder by hand or with an ant script.
If the target folder doesn't exist when you run mvn, it will create it
So my guess is that you have a permissions issue
The user running maven can't create folders in /home/andrew/flume-sources
just as a test, run mvn as root
sudo mvn package
if that works then it is what I said and you will need to 1) chown the folder so that the user running maven can create folders in it (rw) or 2) run mvn from the same user that owns the folder (which i'm guessing is andrew)

Maven - issue running mvn help:effective-pom

I am working through a basic Maven tutorial, and managed to create a simple archetype and run a mvn install. However, when trying to do a mvn help:effective-pom, I just seem to get this output:
mvn help:effective-pom [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building simple 1.0-SNAPSHOT [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- maven-help-plugin:2.2:effective-pom (default-cli) #
simple --- Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 0.925s [INFO] Finished at: Mon May 13 21:41:09 BST
2013 [INFO] Final Memory: 9M/131M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom
(default-cli) on project simple: Execution default-cli of goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom failed:
Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its
dependencies could not be resolved: Failed to collect dependencies for
org.apache.maven.plugins:maven-help-plugin:jar:2.2 (): Failed to read
artifact descriptor for
org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1: Could
not transfer artifact
org.apache.maven:maven-plugin-parameter-documenter:pom:2.2.1 from/to
central (http://repo1.maven.org/maven2): Access denied to:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
-> [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
not much hope for me if I cant get past "Hello World" example...any advice appreciated.
Regards
i
One of your network components blocks access to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom, that's all.

Resources