maven deploy:deploy-file fails (409 Conflict), yet artifact uploads successfully - maven

NOTE:
I now realize that the jar got placed into my repository, but the pom.xml did not. Now, I have another project where the pom.xml fails to get promoted, but the jar is placed in the repository.
However, another project, both the pom.xml and the jar do get placed in the repository.
I have a project in Jenkins where I use the promotion plugin to deploy my artifacts in Maven via the deploy:deploy-file goal.
This works for several other projects I have in Maven, but it fails for this project. The funny thing is that the file (but not the pom.xml) uploads anyway. I've verified this by removing the artifact from our Maven repository, then running the promotion. The artifact is in our repository after the promotion.
Here's the log I'm getting. Broke up the extra long lines the best I could:
[workspace] $ /bin/bash -xe /opt/tomcat/apache-tomcat-7.0.27/temp/hudson7357923598740079329.sh
+ FILE_LOC=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive
+ mvn deploy:deploy-file
-Dversion=0.8.0
-Dfile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/metricsdb-etl.jar
-DpomFile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/pom.xml
-Durl=http://repo.vegicorp.com/artifactory/ext-release-local -DrepositoryId=VegiCorp
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Command Line Spring Batch Module 0.8.0.CI-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) # metricsdb-etl ---
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar
2/38 KB
4/38 KB
[...]
Uploaded: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar (38 KB at 202.2 KB/sec)
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom
2/7 KB
4/7 KB
[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.243s
[INFO] Finished at: Thu Oct 04 14:38:52 CDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file
(default-cli) on project metricsdb-etl: Failed to deploy artifacts:
Could not transfer artifact com.vegicorp.batch.metricsdb:metricsdb-etl:pom:0.8.0 from/to
VegiCorp (http://repo.vegicorp.com/artifactory/ext-release-local):
Failed to transfer file: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom.
Return code is: 409, ReasonPhrase:Conflict. -> [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
failed build hudson.tasks.Shell#24a6e7f9 SUCCESS
Finished: FAILURE
Output with the debug flag (-X) is in Pastebin.

I found the problem. Two problems actually:
I only had the release repository setup, and I was attempting to save a snapshot release in the release repository. Artifactory was setup to only allow releases in the release repository. This can be modified in the Artifactory setting, but I decided against this.
My pom.xml has a different version in it than I was trying to save it to. For example, the pom.xml said version 2.0 and I was trying to save the release as 2.0.2. Artifactory rejected the pom (but not the jar) for this reason.
I found the Artifactory setting (which is per repository) that asks whether or not to "Suppress POM consistency checks". Checking this box will allow me to set the version to one, but have the pom say another.
I also had to modify my Maven "settings.xml" file to allow for both a Release and Snapshot repository. I also have to modify my URL to the snapshot repository.
We were only using Ivy for a while (which doesn't have a snapshot concept), so we were just putting stuff in the release repository. This is a Maven project, and the developer marked the version in the POM as a SNAPSHOT.
Unfortunately, Maven documentation is pretty poor, and there still aren't any good books on Maven. Even worse is that the error messages are simply poor. What does "409, ReasonPhrase:Conflict. -> [Help 1]" mean?
Not that Ivy documentation is so much better, but Ant in Action has some excellent sections on using Ivy.

Ensure that you include -SNAPSHOT as part of your version if you are publishing to the snapshot repository.
And remove -SNAPSHOT in case you are publishing it to a non-snapshot repository.

Yeah....Multiple Reason for same error. May be it will help somebody
1. Login as Admin to Artifactory
2. Configuration -> Repositories
3. Edit the Local Repository ---> Suppress POM Consistency Checks
This solves my problem.... Not sure. Right approach or not ?

I also face this problem, and I found the reason is the parent project didn't deploy in the snapshot repository.
I run mvn deploy in the parent folder, and the problem resolved.

Had that error message too. For me the problem was that the setup of the server is to accept only release, not SNAPSHOT. After removing the SNAPSHOT from the pom, it worked fine.

In my case the POM file associated with the jar file (external, in same dir) had a dependency to itself. This was a offline zipped repo from a third party that I needed to load into artifactory.
I modified the POM files, removed the self-dependency and made sure the package info was right. Then artifacts deployed with no problems. Sent email to vendor so they can fix in their build.

I had this issue as well and it turned out that we had include/exclude rules set up on the repository I was trying to deploy to and my deployment didn't match those rules.
My solution was to point the deployment at a new repository that had **/* as the include rule (and the pattern from my other repository as an exclude rule to keep them separate).

I have been experiencing the same problem.
(TL;DR: solution see last line)
During the deploy from jenkins to Artifactory, sometimes (magic!) a 409 - conflict error appeared with the following error message on the Artifactory log:
[WARN ] (o.a.e.UploadServiceImpl:239) - Sending HTTP error code 409: Checksum policy 'LocalRepoChecksumPolicy: CLIENT' rejected the artifact 'gradle-integration:com.redacted.java/fooProject/123/foo-123.jar'. Checksums info: ChecksumsInfo{checksums={SHA-1=ChecksumInfo{type=SHA-1, original='da39a3ee5e6b4b0d3255bfef95601890afd80709', actual='1459689f0be058f4ecef7e6fe3576f1550a8afda'}, MD5=ChecksumInfo{type=MD5, original='d41d8cd98f00b204e9800998ecf8427e', actual='14c7a498de028d6eb5882b3c698bc456'}}}.
As the trained eye might notice: The MD5# d41d8cd98f00b204e9800998ecf8427e is the checksum for an empty file or string.
Which means that the following must be happening:
The copy job that prepares the Artifacts in the publish folder had not finished and therefore the file was empty when the checksum was calculated.
However when the deploy happened the file was there, Artifactory now receives a checksum which is incorrect and correctly refuses the file with the error code 409.
THE SOLUTION (is simple):
Make 100% sure the files are definitely there before you start the deploy job (add a pause or proper logic).

There is a good possibility that the space on your remote repo is full. Verify that before going all technical and wasting time. Wasted 2-3 hrs thinking its a logical problem.

In my case the root cause for that very error was dependency version property that was not in the root pom.
The solution was moving the property to root pom where the version for the dependency was required.
So, missing version property of a dependency.
Very misleading error message indeed.

The world snapshot was written in lower case inside the pom.xml file. It must be written in upper case.
Ali

Related

Error when trying to 'mvn clean install' Gerrit's replication plugin

This is probably a newbie question, but I'm new to Maven.
I'm trying to build Gerrit's replication plugin, "since the master branch (and thus Gerrit 2.5) no longer supports replication out of the box."
So I did clone https://gerrit.googlesource.com/plugins/replication and executed mvn clean install inside the new directory. The error message is:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building replication 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.google.gerrit:gerrit-plugin-api:jar:2.6-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.840s
[INFO] Finished at: Thu Apr 25 17:30:10 BRT 2013
[INFO] Final Memory: 6M/105M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project replication: Could not resolve dependencies for project com.googlesource.gerrit.plugins.replication:replication:jar:1.1-SNAPSHOT: Failure to find com.google.gerrit:gerrit-plugin-api:jar:2.6-SNAPSHOT in https://gerrit-api.commondatastorage.googleapis.com/release/ was cached in the local repository, resolution will not be
reattempted until the update interval of gerrit-api-repository 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 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
It looks like this URL isn't valid: https://gerrit-api.commondatastorage.googleapis.com/release/ -- but like I said, I'm new to Maven so I'm not sure how to proceed. I did some research, but I don't know what I'm looking for.
Any pointer would be highly appreciated. Thanks in advance.
A couple of things -
You are missing the gerrit-plugin-api.jar. This currently isn't provided upstream, so you must build it yourself. I believe running mvn install from a Gerrit repository will package and add this jar to your system.
You don't want to run install, you just want to run package on the plugin. mvn package will put the .jar in the target/ folder, which you then copy to your plugins folder inside your Gerrit installation.
Good luck!
Like Brad mentioned, I am missing the gerrit-plugin-api.jar. Unfortunately, I was not able to build it, since the Gerrit repos seem to be facing issues lately, as mentioned in other threads (this one, for instance - from two days ago).
Anyway, below are my additional steps based on Brad's answer (hopefully this may help others):
git clone https://gerrit.googlesource.com/gerrit
cd gerrit/gerrit-plugin-api/
mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Gerrit Code Review - Plugin API 2.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.google.gerrit:gerrit-sshd:jar:2.7-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.gerrit:gerrit-httpd:jar:2.7-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.gerrit:gerrit-pgm:jar:2.7-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.342s
[INFO] Finished at: Fri Apr 26 10:52:54 BRT 2013
[INFO] Final Memory: 5M/105M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project gerrit-plugin-api: Could not resolve dependencies for project com.google.gerrit:gerrit-plugin-api:jar:2.7-SNAPSHOT: The following artifacts could not be resolved: com.google.gerrit:gerrit-sshd:jar:2.7-SNAPSHOT, com.google.gerrit:gerrit-httpd:jar:2.7-SNAPSHOT, com.google.gerrit:gerrit-pgm:jar:2.7-SNAPSHOT: Failure to find com.google.gerrit:gerrit-sshd:jar:2.7-SNAPSHOT in https://gerrit-maven.commondatastorage.googleapis.com was cached in the local repository, resolution will not be reattempted until the update interval of gerrit-maven 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 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
EDIT
These are the steps that worked for me, in case someone else faces the same issue.
git clone https://gerrit.googlesource.com/gerrit
Check available 'versions'
git branch -r
git checkout -b 2.5 origin/stable-2.5
The steps didn't work on the master branch in my environment, and I'm using 2.5...
So yeah, 2.5.
cd gerrit
mvn clean install
This will rebuild the entire universe, go grab a cup of coffee. :)
.. when done
cd gerrit-plugin-api/
mvn package
This also takes some time...
If everything goes fine, you can copy the jar at the target folder, like:
cp target/<large-name>.jar ~/replication.jar
Finally install it (from ~):
ssh -p 29418 localhost gerrit plugin install -n name \ - <replication.jar
Details on how to install Gerrit plugins are here.
The thing is, now I'm getting another error, something like:
"A binding to (something) was already configured at (something)."
But that's another story / thread / post...
Thanks and good luck!
Do a mvn -P all clean install on the toplevel, not inside gerrit-plugin-api.
The fastest way to fix is is to change the pom.xml and use a version that is not a snapshot. I was trying to build the delete-project for the stable-2.6 branch and was facing the same issue. All that needs to be done is to change the Gerrit-ApiVersion:
<Gerrit-ApiType>plugin</Gerrit-ApiType>
- <Gerrit-ApiVersion>2.6-SNAPSHOT</Gerrit-ApiVersion>
+ <Gerrit-ApiVersion>2.6-rc2</Gerrit-ApiVersion>
</properties>
<name>Delete Project Gerrit Plugin</name>
Building off of #Conaaando's answer, I performed these exact steps and successfully am using the plugin. Steps courtesy of http://asheepapart.blogspot.com/2013/12/how-to-build-gerrit-replication-plugin.html
git clone --recursive https://gerrit.googlesource.com/gerrit
You need the --recursive here because the plugins are actually git submodules and won't otherwise be cloned along with your repo.
If you've already cloned, you can run git submodule init; git submodule update
cd gerrit
git checkout -b stable-2.7 origin/stable-2.7
mvn install -DskipTests=true -Dmaven.javadoc.skip=true
It's not necessary to skip the tests or generating Java Doc, but it will greatly improve your compile time and decrease the amount of memory maven uses
cd gerrit-plugin-api
mvn package -Dmaven.javadoc.skip=true
This creates the jar that will be necessary for the replication plugin to get built
cd plugins/replication
mvn package -Dmaven.javadoc.skip=true
At this point, you have compiled and packaged the replication jar! All you need to do now is register it with your Gerrit server. For simplicity, I'll pretend your gerrit server is running at gerrit.example.com. These steps copy the replication jar to your review server and then instruct the review server to install the plugin from that copied location.
scp target/replication-2.7.jar gerrit.example.com:/tmp/
ssh -p 29418 gerrit.example.com gerrit plugin install -n replication /tmp/replication-2.7.jar

Maven Jenkins Plugin POMs missing for dependency information on JARs

I have been trying to follow the tutorial here: https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
I have spent about 7 hours on this now and finally decided to just ask and hope for a response.
I haven't edited the pom file at all from the create command. I am pretty sure I have my settings file correct. When I try to run or package the project though I get this:
[WARNING] The POM for org.apache.maven.surefire:surefire-booter:jar:2.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven.surefire:maven-surefire-common:jar:2.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven:maven-toolchain:jar:2.0.9 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.260s
[INFO] Finished at: Tue Jan 29 16:07:56 EST 2013
[INFO] Final Memory: 41M/387M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project helloworld: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.9 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.surefire:surefire-booter:jar:2.9, org.apache.maven.surefire:maven-surefire-common:jar:2.9, org.codehaus.plexus:plexus-utils:jar:2.1: Failure to find org.apache.maven.surefire:surefire-booter:jar:2.9 in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced ->
So I am assuming that it is supposed to be downloading these 3 jar files from the repositories I set up in the settings file... but it isn't. Is there any reason this would happen? Anything I can do to make it download these files? Or is it downloading them I am just not referencing them correctly somewhere? I'm pretty new to this so i could be completely off.
If it helps I have maven 3.0.4 and jdk 1.7.0_02. Everything else I have pretty much copy and pasted from the tutorial I think. Any help would be greatly appreciated!
Something went probably wrong when you attempted to get the artefacts the first time, and now you are stuck because of a nasty maven bug. Maven might have created an empty folder in your local repository (.m2) and now thinks you already have the dependency. So you should check if this is what happened and, if so, deleted the folder.
See my answer here :
Compiler error "archive for required library could not be read" - Spring Tool Suite
And you can also check why there was a problem in the first place. Do you access the following url with your browser ?
http://repo.jenkins-ci.org/public/org/apache/maven/surefire/surefire-booter/2.9/

Jenkins Build fails while compiling java code using Maven

I have a Java application and I am able to compile it using maven on CLI, I have a couple of build scripts to deploy the Java code to a remote server and compile the code using Maven but unfortunately the build fails while compiling it using my build script for Jenkins. When I try to compile the code on the remote server the build is successful. The error log is as follows:
[WARNING] The POM for org.im4java:im4java:jar:1.3.2 is missing, no dependency information available
[WARNING] The POM for com.aliyun:aliyun-openservices:jar:1.0.0-20120705 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GuestPath Project ................................. SUCCESS [5.183s]
[INFO] guestchat biz module .............................. FAILURE [4.001s]
[INFO] GuestChat Web Common .............................. SKIPPED
[INFO] GuestChat Portal Webapp ........................... SKIPPED
[INFO] guestchat openapi Webapp .......................... SKIPPED
[INFO] guestchat chat server ............................. SKIPPED
[INFO] guestchat service dashboard Webapp ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.518s
[INFO] Finished at: Wed Sep 19 10:49:39 CST 2012
[INFO] Final Memory: 9M/23M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project guestchat-biz:
Could not resolve dependencies for project com.guestops.guestchat:guestchat-biz:jar:1.0.0-SNAPSHOT:
The following artifacts could not be resolved:
org.im4java:im4java:jar:1.3.2, com.aliyun:aliyun-openservices:jar:1.0.0-20120705:
Failure to find org.im4java:im4java:jar:1.3.2 in http://repo.maven.apache.org/maven2
was cached in the local repository, resolution will not be reattempted until
the update interval of central has elapsed or updates are forced -> [Help 1]
I hope I am being clear enough, any help is highly appreciated. I can provide with more details if needed..Thanks in advance!
I think you should try to do the following:
Try to compile the project locally but make sure you're downloading the artifacts from the maven repository. Radically you can do it by renaming your ~user/.m2/repository and running ''mvn clean install''
If it compiles - your local maven is configured properly and its not a pom.xml issue. Also the remote repositories are configured right in maven. In this case its a jenkins issue or rather the issue of maven installed on the same machine with jenkins or maybe some network/security related issue (like a connection to the remote repository is firewalled and not accessible from the jenkins machine and so on).
I would suggest to check out the repository configuration on that maven, or if you want checkout the source code of your project on the jenkins machine and manually run the first step described above from that machine. You should see that the code can't be compiled and get the same error you're getting now.
Now if in during the step 1 the project can't be compiled - its just because you have had a dependency on the lacking module and they were somehow presenting in your local repository (I assume previously it could be compiled locally) and since we're kind of running a clean installation the local repository 'gets purged'. In this case you should find out where do your dependencies come from.
Things like
mvn dependency:tree on the failing module
Can be helpful here.
Hope this will help somehow
2 possible quick solutions:
If it compiles locally, then go to the build configuration on Jenkins and check the "Poll SCM" option to do polling on every build.
Run from the command line on Jenkins server mvn clean install and make sure that the artifacts are available in maven repository after the build. If they are not, download the jars of the relevant versions and put them in the local maven repository (on Jenkins server).
Good luck!
This is what the error message tells you:
The following artifacts could not be resolved:
org.im4java:im4java:jar:1.3.2,
com.aliyun:aliyun-openservices:jar:1.0.0-20120705: Failure to find
org.im4java:im4java:jar:1.3.2 in http://repo.maven.apache.org/maven2
So you have references in your pom for im4java 1.3.2 and aliyun-openservices 1.0.0-20120705, but these cannot be found in the general maven repo. If you do a search for im4java in mvnrepository.com, you'll see that it only has version 1.2, so it is reasonable that it would fail. aliyun-openservices package doesn't exist there at all.
So, where should those be found? Maybe you have installed them locally only and not to Jenkins machine?
What you can do then, is either
(recommended) set up an intranet maven repo where you would deploy the needed libraries and reference that or
install them locally on the machine running Jenkins
Both of these should fix the issue.
A quick look on maven repository, only version 1.2.0 is available and not version 1.3.2 (which you are using).
Does your code compile with a maven build?
I suggest you try to review the repository setting on the jenkins instance

Maven missing project required libraries after cloning repo

A team member has shared his project with me on bitbucket and he used maven to manage his dependencies. After cloning the repo (using mercurial) into my workspace (Eclipse) and downloading maven, m2e and all the other required set up files i was able to get all of the project libraries except for 4.
After downloading the project, i ran several mvn commands to clean, install and hopefully download these missing jars. When i ran mvn -e command i get this long error that does nothing to help. Do i have to find and download these 4 jars and put them in my maven repo?
Command output: mvn -e
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.769s
[INFO] Finished at: Mon Apr 09 17:42:17 CDT 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Dugsi_Manager: Could not resolve depen
dencies for project org.bixin.dugsi:Dugsi_Manager:war:0.1.0.BUILD-SNAPSHOT: The
following artifacts could not be resolved: org.eclipse.persistence:eclipselink:j
ar:2.2.0, org.eclipse.persistence:javax.persistence:jar:2.0.3, org.vaadin:icepus
h-gwt:jar:0.1.2, org.jqurantree:jquran:jar:1.0.0: Could not find artifact org.ec
lipse.persistence:eclipselink:jar:2.2.0 in spring-maven-release (http://maven.sp
ringframework.org/release) -> [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]
EDIT:
I just need to share my local repository with all other team members that clone my project. External jars that dont use maven have to be manually installed into my local repo, this creates a problem because i cant share my local repo? Any ideas
You can either install these JARs in your local repository, or setup an own (possibly private) maven repository for you to share with your team. Sonatype provides with Nexus OSS an open-source based software to easily set up a repository (which also proxies remote ones if you like).

Jenkins (hudson) plugin development meet maven-enforcer-plugin:1.1-SNAPSHOT issue

I try to develop one jenkins (a.k.a hudson) plugin, and follow the Tutorial, and generated source code tree after mvn -cpu hpi:create command.
While when I do "mvn package", it reports error like
[INFO] Building Unnamed - com.example.jenkins:redmine2:hpi:1.0-SNAPSHOT
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-enforcer-plugin
Reason: Error getting POM for 'org.apache.maven.plugins:maven-enforcer-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
org.apache.maven.plugins:maven-enforcer-plugin:pom:1.1-SNAPSHOT
from the specified remote repositories:
nexus (http://maven.nexus.local:8888/nexus/content/groups/public)
for project org.apache.maven.plugins:maven-enforcer-plugin
From my nexus server, it has maven-enforcer-plugin:1.0 version only, but this dependence is generated from jenkins by default, anyone can help me to solve it ?
(How) Can I change to plugin-1.0 version.
what can I add in nexus server
I just have basic knowledge of maven.
I fixed it by myself by doing two things.
1. Added Apache snapshot from here into my nexus repo group besides those setting in Tutorial
2. It seems my local maven repo is messed up as well, so I can clean it up and reload from nexus.
And it still use maven-enforcer-plugin:pom:1.1-SNAPSHOT plugins.
Hope it helps you as well.

Resources