Error while displaying javadocs in Jenkins - jenkins

I am trying Jenkins with the help of the book - "Jenkins - The Definitive Guide"
I am getting error while displaying javadocs:
[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.5.2 or
one of its dependencies could not be resolved: Cannot access central
(https://repo.maven.apache.org/maven2) in offline mode and the
artifact org.apache.maven.plugins:maven-install-plugin:jar:2.5.2 has
not been downloaded from it before. -> [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 Build step 'Invoke top-level Maven targets' marked build as failure
Both Java and Maven are installed on the machine where Jenkins is running.
I have the following info from the command line
$ mvn -version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-32-generic", arch: "amd64", family: "unix"
Any hint to get around this issue?
--------------------- EDIT ---------------------------
After the last comment I made the changes as suggested and now I got the following errors:
[ERROR] Failed to execute goal on project gameoflife-web: Could not resolve dependencies for project com.wakaleo.gameoflife:gameoflife-
web:war:1.0-SNAPSHOT: Could not find artifact
com.wakaleo.gameoflife:gameoflife-core:jar:1.0-SNAPSHOT -> [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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :gameoflife-web
Build step 'Invoke top-level Maven targets' marked build as failure
Recording test results
Publishing Javadoc
Finished: FAILURE

Related

Allure report in Jenkins does not load and it shows the loading on browser

I have used allure report in my framework for reporting.
After completion of test scripts on Jenkins and clicking allure report icon, it does not load the reports it show loading.
Allure Jenkins Plugin version = 2.10
Following is the Jenkins console output:
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-test) on project com.fa.ipsy: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/Edu/jenkins/workspace/Appium_android/target for the individual test results.
[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
Build step 'Execute shell' marked build as failure
[Appium_ipsy_mobile] $ /Users/Edu/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/1.4.23.HOTFIX1/bin/allure generate "/Users/Edu/jenkins/workspace/Appium_android/target/allure-results" "/Users/Edu/jenkins/workspace/Appium_android/allure4208353174449196512.tmp/environment" -o "/Users/Edu/jenkins/workspace/Appium_android/allure4208353174449196512.tmp/allure-report"
Report successfully generated to the directory </Users/Edu/jenkins/workspace/Appium_android/allure4208353174449196512.tmp/allure-report>. Use `allure report open` command to show the report.
Finished: FAILURE
Thank you for the Help
The Issue is resolved now, we are able see the Allure HTML reports.
We have updated our Allure Jenkins plugin Version (2.10) to 2.26.0.
Thanks

Permission denied while running maven command jenkins

I am facing permission denied issues while running a maven clean test on a pom.xml present in /home/tes/pom.xml from jenkins. Any suggestions
Building in workspace /var/lib/jenkins/workspace/jenkins
[jenkins] $ /usr/share/maven/bin/mvn -f /home/tes/pom.xml clean test
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (/home/tes/pom.xml) has 1 error
[ERROR] Non-readable POM /home/tes/pom.xml: /home/tes/pom.xml (Permission denied)
[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/ProjectBuildingException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Just grant read access for all to the pom.xml file:
chmod +r /home/tes/pom.xml
The moderator has deleted my previous answer; I know that it has passed some time since this first post, but I ended up exactly in the same place. I insist in complementing all the answers because I've found what was the problem in my case,having the same result as reported in this case.
I'd like to comment that, in my case, the reason was that I did not have JDK, but just JRE configured in JAVA_HOME of the Global Tool Configuration > JDK > JDK Installation. As a matter of fact Jenkins warns you that the path is not pointing to something containing a JDK.
JDK is needed for some Plugins, like Maven Integration or Docker Pipeline, as Java requirements section in Jenkins documentation states. So this must checked because it surprisingly results in the weird error:
> git rev-parse refs/remotes/origin/celsus_0-1-0^{commit} # timeout=10
Checking out Revision 0c533cf2327a416a254afa2348abafe7790ba67f (refs/remotes/origin/celsus_0-1-0)
> git config core.sparsecheckout # timeout=10
> git checkout -f 0c533cf2327a416a254afa2348abafe7790ba67f # timeout=10
Commit message: "first embrio of container image"
> git rev-list --no-walk 0c533cf2327a416a254afa2348abafe7790ba67f # timeout=10
Parsing POMs
Established TCP socket on 40251
[build] $ /usr/lib/jvm/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/share/maven/conf/logging jenkins.maven3.agent.Maven35Main /usr/share/maven /var/cache/jenkins/war/WEB-INF/lib/remoting-4.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar 40251
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "/usr/lib/jvm/bin/java" (in directory "/var/lib/jenkins/workspace/build"): error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at hudson.Proc$LocalProc.<init>(Proc.java:252)
at hudson.Proc$LocalProc.<init>(Proc.java:221)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:996)
at hudson.Launcher$ProcStarter.start(Launcher.java:508)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:280)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:802)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514)
at hudson.model.Run.execute(Run.java:1907)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
... 13 more
Finished: FAILURE
Similar case as originated this case, as the different nature of the solutions proposed points out. I'd like to bring the attention that these errors having to do with permissions, or parsing of the pom might hide the real root cause, and error messages are not always as explicit and clear as they should be.
Hope it helps others bumping into the same issue.
I installed maven plugin for jenkins and provided the fully qualified path of pom.xml in root pom.xml and it fixed the issue
I think the reason this happens is maven has the right to run pom.xml ie. mvn command can be run through terminal but not through jenkins.
So we will need to add the current user to jenkins for it to work.
Follow this blogpost. It worked for me:
blogpost

Usergrid Build Error

while I'm trying to build Usergrid, I'm coming across the following error.
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.752 s
[INFO] Finished at: 2015-12-16T01:02:23+03:30
[INFO] Final Memory: 20M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project usergrid-rest: Could not resolve depen
dencies for project org.apache.usergrid:usergrid-rest:war:2.1.1-SNAPSHOT: Failur
e to find org.apache.usergrid:usergrid-java-client:jar:0.0.10-SNAPSHOT in file:/
/C:\usergrid-master\stack\rest/../m2/repository was cached in the local reposito
ry, resolution will not be reattempted until the update interval of local-depend
encies has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
C:\usergrid-master\stack>mvn clean install -rf :usergrid-rest
Any solution ?!?
You need to build sdks/java first in order to build the stack.
cd C:\usergrid\sdks\java
mvn install
cd ..\..\stack
mvn install -DskipTests=true

need help Mahout in Action chapter 2 examples

i need your help
i want setup recommender system with mahout
i install java & eclipse & maven on centos 6 then itegerated eclipse with maven
mvn -version
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 06:45:32+0430)
Maven home: /usr/local/maven
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-71.el6.i686", arch: "i386", family: "unix"
then i install mahout according to your instruction and total step done successfully
but when check command:
mvn exec:java -Dexec.mainClass="mia.recommender.ch02.IREvaluatorIntro" -Dexec.args="src"
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project mia: An exception occured while executing the Java class. null: InvocationTargetException: intro.csv -> [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
i am beginner please help me to resolve error
i need your help
Thank you
I would start by checking that the file intro.csv is available and usable.

Why mvn archetype does not work for me?

I'm new on Maven and there's something wrong when I try to create a now project.
E:\java\MavenTest>mvn archetype:generate -DgroupId=com.mycompany.app -DartifacId
=my_app -DarchetypeArtifacId = maven_archetype_quickstart -DinteractiveMode=fals
e
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.108s
[INFO] Finished at: Wed May 15 23:55:57 CST 2013
[INFO] Final Memory: 7M/76M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (E:\java\MavenTest). Please verify you invoked Maven from the
correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject
Exception
The pom.xml should be generated automatically. But it does not work.
Any help will be highly appreciated.
The root cause are as the following: -
There is a space at -DarchetypeArtifacId = maven_archetype_quickstart
The archetypeArtifacId should be maven-archetype-quickstart
The -DarchetypeArtifacId is miss spelling, the correct is -DarchetypeArtifactId
Then please try the following: -
mvn archetype:generate
-DgroupId=com.mycompany.app
-DartifactId=my_app
-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifacId=maven-archetype-quickstart
-DarchetypeVersion=1.1
-DinteractiveMode=false
Please type above command in the single line.
I hope this may help.
Another answer will be related to the console that you are using to generate the maven project with the archetype:
For example:
With Powershell, the command of the answer doesn't work but with this command is working properly
mvn archetype:generate
"-DgroupId=com.mycompany.app
-DartifactId=my_app
-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifacId=maven-archetype-quickstart
-DarchetypeVersion=1.1
-DinteractiveMode=false"
because of the problems passing the arguments to the maven command.
This is gonna help somebody, it works for me!

Resources