I am trying to get my Jenkins CI setup to deploy to Sonatype Nexus.
On my personal machine, running gradle upload runs fine, but when running it on Jenkins, I get this error (I added --stacktrace to get the whole error instead of just BUILD FAILED): http://pastebin.com/RPQQxZCg
Line 119 is what I believe to be the problem.
I have looked around the internet for hours but haven't found any resolutions to this problem.
My build.gradle is here. The jar builds fine, just doesn't deploy.
If you need any more information, please let me know!
Related
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).
I have a maven build for building an eclipse plugin which gets hung sporadically during the execution of
--- tycho-p2-repository-plugin:1.1.0:assemble-repository (default-assemble-repository) # com.sample.product ---
Otherwise the build will get failed saying the following error.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:1.1.0:assemble-repository (default-assemble-repository) on project p2:Could not assemble p2 repository: Mirroring failed: No repository found at file:/C:/Users/obuli/.m2/repository/.
I am using the following maven goals and options
clean deploy -Dtycho.localArtifacts=ignore
I have searched for this issue and landed on this Bug , It says there was a bug in tycho 0.26.0 But I am currently using Tycho version 1.1.0
Since the issue is very sporadic I could not able to identify the root cause. Please let me what I am missing here.
I intermittently had this problem as well. After running mvn clean and mvn deploy separately once, mvn clean deploy started working as well.
Now I don't seem to be able to recreate the original issue, even using git clean -xfd and deleting all snapshots from the local and remote repository.
I can only guess that there were some leftover files from earlier builds which were not cleaned by mvn clean deploy but by mvn clean, and these leftover files must have broken the build.
I currently have a travis-ci setup that runs a build out of a github repository. Previously I had no need for snapshots in oss.sonatype.org but now I do. I'm getting an error saying that the dependency can't be found meaning that travis-ci I assume does not use it as the default maven repo. How can I tell travis to use oss.sonatype.org as well as its default repo's setup?
edit 1: Upon further investigation i found that travis is apparently setup to use central and sonatype mirrors so i'm not sure what's going on at all.
https://travis-ci.org/FINRAOS/herd/builds/298071150
During our intraday builds, we intermittently (perhaps twice a day) get a '401 Unauthorized' error when maven performs the 'deploy' step of the build. This error is seen on both the maven console and in the Artifactory requests.log. The time of day isn't consistent, nor is it tied to a snapshot/release repository. I've checked and doublechecked all security settings and urls, and since this error is intermittent, I'm confident the issue lies with Artifactory.
I also get this intermittently with a 'mvn deploy:deploy-file'. Today it failed on 1 upload out of approx 300.
I've raised a jira with Artifactory but it's not been picked up yet: https://www.jfrog.com/jira/browse/RTFACT-14982
I should add that we didn't encounter this issue when using Archiva as our repository. It's happened regularly since I migrated to Artifactory
With regards to the pom.xml example, the reason it is failing is that the deploy-file goal is missing the repositoryId property.
This property should include the repository id for the repository you use for deployment, for example:
<repositoryId>internal-snapshot-local</repositoryId>
The plugin will use this id for getting the deployer credentials from the Maven settings.xml file.
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.