execute command mvn clean install failed when integrate with Jenkins - maven

I try to build Jenkins with maven project and in goal I defined: clean install.
But it failed with the below reason:
I try to execute the command mvn clean install in command line but it works fine even with eclipse IDE.
I also check the network and see I can connect successfully.
Any solution in this case.

By default, Jenkins can't access the internet if you are under Proxy. So please configure proxy in jenkins. Here I am attaching a link to configure the jenkins. Hope this helps. If anything comes up, please comment below.

Related

Maven: is there a simple command to test repository access?

Some of my users have trouble accessing our local Nexus repository. Some of them are somewhat newbies in maven configuration. Sure they can test if everything is downloading fine running mvn install, but I'd like to help them to isolate their environment problems.
Is there a simple mvn command just to test if the repository access is correctly configured?
Use
mvn help:effective-settings
A simple
mvn clean
test the repository access.
I had a number of dependencies that failed to download from the Maven Central repository (apparently due to network throttling/flakiness). Running "mvn clean" just immediately returned with the same errors, obviously not attempting any more downloads. But its message said to rerun with "-x" option to see the full stack trace, so I ran:
mvn clean -x
This caused it to retry and download more. It took several tries to get all dependencies downloaded, but it did eventually run to completion. It didn't give me any stack traces, and I still don't know what was causing the failures (the repository was reachable the whole time).

Unable to Build in Jenkins with Maven Build Profile

I am trying to build a maven project in Jenkins with Build Profile ID of pom.xml. But Jenkins is only building with dev profile and not catching any of other profiles. with the same pom.xml.
I've tried building on command prompt and it's working fine, I just cannot do it in Jenkins.
I am having similar issue running maven 3.3.9 from Jenkins ver. 2.138.
So far, with time consuming trial and error, I have found that Jenkins does not tolerate a space between the -P and the profile name AND it can only handle a single profile. So you should be able to get something like this to work:
mvn groupId:artifactId:goal -Pprofile-1-only
how did you set-up your Jenkins to run the command?
Profiles should b specified using the -P option:
mvn groupId:artifactId:goal -P profile-1,profile-2
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
My guess is that in your Jenkins config (build steps), you have not specified anything, or you provide the wrong profile.
Could you try and let us know?

mvn -PautoInstallPackage install throwing error Failed to execute goal org.apache.maven.plugins

getting error Failed to execute goal org.apache.maven.plugins while running command mvn -PautoInstallPackage install for creating AEM 6.3 Project using adobe archetype11, following steps mentioned in article https://helpx.adobe.com/experience-manager/using/maven_arch11.html. I am using setting.xml available in this article. But when I remove proxy from setting.xml the build was successful using cmd mvn -PautoInstallPackage. How can I achieve build success without removing proxy tag from setting.xml?
used local.net|some.host.com and local.net|some.host.com . Still the issue exists. Please provide a help.
Deleting full .m2/repository local repository may solve your problem.
Or else you need to know what plugins are you using exactly with their dependencies as one of the plugin suffered a problem while downloading

SSH.NET compile Errors through jenkins

I have some issues when try to compile the project using Jenkins. Locally it works fine using SSH.NET, but when I put my code to the windows server 2012R2 and using Jenkins build there. It shows me an error:
"SSH.NET" has already has a dependency defined for "SshNet.Security.Cryptography".
and build fail. Anyone knows what happened in the server side? Why it works locally but has compile errors in the server side?
Thanks
Please check whether your Jenkins installed SSH related plugins. Following screenshot shows the SSH related plugins installed in my Jenkins.
Then please check your Jenkins Configurations whether you configure any SSH related build configurations. In my successful build, I don't choose any SSH related options in build configurations. Please check your Build Configurations based on following screenshot. My project also installed SSH.NET package and it clone from GitHub. Except the project Url and Repositories Url, other options are in the default value.

Jenkins Inegration with TestNG.(when running from jenkins it's not invoking browser)

My project contains (Webdriver,Maven3.05,jenkins) when I run maven command "mvn test" , test will trigger and browser will be invoked, the same set when i had configured using jenkins it will run the tests but browser will not be invoked.Please help me where iam going wrong.(I had installed testng plugin for jenkins all necessary configurations are taken care).
Try starting jenkins using the command line:
java -jar jenkins.war
Usually in Windows not all the services are allowed to use the interface
Hope helps!

Resources