Push docker image to Nexus - maven

Hello I have Jenkins and Nexus on the same server. When Jenkins build project correctly, i want push image to Nexus 3, but every time i have the same problem (log below).
Configuration:
pom.xml
<nexus.url>http://adress/#browse/browse/components:docker-image</nexus.url>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>${nexus.url}</url>
</snapshotRepository>
</distributionManagement>
...
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.4</version>
<extensions>true</extensions>
<configuration>
<serverId>nexus</serverId>
<nexusUrl>${nexus.url}</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
And i have file settings.xml:
<servers>
<server>
<id>nexus</id>
<username>login</username>
<password>password</password>
</server>
</servers>
Then i try "mvn clean deploy" and result is:
[INFO] Deploying remotely...
[INFO] Bulk deploying locally gathered artifacts from directory:
[INFO] * Bulk deploying locally gathered snapshot artifacts to URL http://adress/repository/image-docker/
Downloading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/maven-metadata.xml
Uploading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar
Uploading: http://adress/repository/image-docker/someProject//0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2016-12-13T10:30:35+01:00
[INFO] Final Memory: 75M/748M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.4:deploy (injected-nexus-deploy) on project someProject:
Failed to deploy artifacts: Could not transfer artifact someProject:jar:0.1-20161213.093022-1 from/to nexus (http://adress/repository/image-docker/):
Failed to transfer file: http://adress/repository/image-docker/someProject/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar.
Return code is: 502, ReasonPhrase: Bad Gateway. -> [Help 1]
Every time is the same problem with 502 - Bad Gateway.
Do you have some proposal?

Unfortunately this will not work for a few reasons.
The URL you are using as a Nexus url is wrong, that URL is the browser URL. You need to use something more akin to https://nexusurl:portofdockerhostedrepo/repository/nameofdockerhostedrepo. You can get more information on setting up and pushing Docker images here: https://books.sonatype.com/nexus-book/reference3/docker.html#docker-push
Unless I'm completely wrong, mvn deploy is primarily for deploying maven artifacts into Maven repositories. I don't think this will work if you are attempting to deploy a Docker image. You might take a look at using something like this: https://github.com/spotify/docker-maven-plugin
Hope this helps.

Related

How to deploy an artifact into Amazon S3 with Maven?

I'm trying to follow these tutorials (1,2) to achieve the mentioned goal. But I'm still getting this error from Maven:
INFO] Installing /home/valter/temp-workspace/document-engine/target/application-1.0.0.CI-SNAPSHOT.jar to /home/valter/.m2/repository/com/company-solutions/application/1.0.0.CI-SNAPSHOT/application-1.0.0.CI-SNAPSHOT.jar
[INFO] Installing /home/valter/temp-workspace/document-engine/pom.xml to /home/valter/.m2/repository/com/company-solutions/application/1.0.0.CI-SNAPSHOT/application-1.0.0.CI-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # application ---
Downloading: s3://myrepo.company.solutions/snapshot/com/company-solutions/application/1.0.0.CI-SNAPSHOT/maven-metadata.xml
[WARNING] s3://myrepo.company.solutions/snapshot - Connection refused
[WARNING] Could not transfer metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml from/to s3.snapshot (s3://myrepo.company.solutions/snapshot): Could not connect to repository
[INFO] Logged off - myrepo.company.solutions
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:31 min
[INFO] Finished at: 2015-11-16T18:36:26+01:00
[INFO] Final Memory: 181M/1289M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project application: Failed to retrieve remote metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml from/to s3.snapshot (s3://myrepo.company.solutions/snapshot): Could not connect to repository: Status Code: 400, AWS Service: Amazon S3, AWS Request ID: 709B60A05E8E7062, AWS Error Code: InvalidRequest, AWS Error Message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. -> [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
These are my local files, ~.m2/settings.xml (with fictious values, of course):
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>s3.site</id>
<username>access_key</username>
<password>private_key</password>
</server>
<server>
<id>s3.release</id>
<username>access_key</username>
<password>private_key</password>
</server>
<server>
<id>s3.snapshot</id>
<username>access_key</username>
<password>private_key</password>
</server>
</servers>
</settings>
And my pom.xml:
<project>
<build>
<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
</extensions>
...
</build>
<distributionManagement>
<site>
<id>s3.site</id>
<url>s3://myrepo.company.solutions/site</url>
</site>
<repository>
<id>s3.release</id>
<url>s3://myrepo.company.solutions/release</url>
</repository>
<snapshotRepository>
<id>s3.snapshot</id>
<url>s3://myrepo.company.solutions/snapshot</url>
</snapshotRepository>
</distributionManagement>
...
</project>
I'm using Maven 3.3.3.
EDIT
This is my policy simulator result:
Just to let you guys know what happened.
The problem was the region of my bucket was Frankfurt, which requires the newest version of authentication from Amazon AWS, version 4. As far as I can tell, the plugin aws-maven doesn't support this new version right now. So the solutions was to move my bucket to another region which support the older version of schemes, like US Standard. And everything seems to work fine now!

Nexus Issue while trying to Upload Snapshots into Nexus Snapshot repository

I am getting the following error in Nexus Snapshot repository while trying to upload snapshots.
Downloading: http://maven.teamccp.com/content/repositories/snaphot/apps/home/home-parent/2.1-SNAPSHOT/maven-metadata.xml
Uploading: http://maven.teamccp.com/content/repositories/snaphot/apps/home/home-parent/2.1-SNAPSHOT/home-parent-2.1-20141113.150651-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Home Parent ............................... FAILURE [ 0.742 s]
[INFO] Home Commons .............................. SKIPPED
[INFO] Home app .................................. SKIPPED
[INFO] Distribution ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.860 s
[INFO] Finished at: 2014-11-13T10:06:51-05:00
[INFO] Final Memory: 4M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project home-parent: Failed to deploy artifacts: Could not find artifact apps.home:home-parent:pom:2.1-20141113.150651-1 in snapshot (http://maven.teamccp.com/content/repositories
I am able to successfuly upload releases. Plz help. Thanks in advance.
The nexus manager has default snapshot repository, which is where your organization will publish internal snapshots. Your deploy cannot find distributionManagement of snapshotRepository, so the error will occur like your question. Therefore, you should set snapshotRepository for deploy your snapshot artifacts. The example is shown below.
pom.xml
<distributionManagement>
<repository>
<id>releases</id>
<url>http://your-hostname:port/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://your-hostname:port/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
settings.xml
<server>
<id>releases</id>
<username>your-server-username</username>
<password>your-server-password</password>
</server>
<server>
<id>snapshots</id>
<username>your-server-username</username>
<password>your-server-password</password>
</server>
Each Uploading: line should be followed by a corresponding Uploaded: line, and since that's missing, my guess is that your upload failed for some reason. I'd check your Nexus logs to see if there's any indication.
I experienced the same problem when my remote repository was out of space (which I found by logging onto the server); I didn't see anything in the Artifactory log.

mvn deploy snapshot to nexus oss failed with return code 500 internal error

I use maven to deploy artifact to sonatype nexus,I can perform release action normally,but deploy snapshots failed.
sonatype nexus 2.7.0.5
Java 1.7
maven 3.0.5
mvn release:prepare;mvn release:perform; successful without any error
mvn deploy failed with return code 500
[INFO] maven-jar-plugin:2.4:jar (default-jar) # licm
[INFO] Building jar: /foo/licm/trunk/target/licm-0.2.9-SNAPSHOT.jar
[INFO]
[INFO] maven-install-plugin:2.3.1:install (default-install) # licm
[INFO] Installing /foo/licm/trunk/target/licm-0.2.9-SNAPSHOT.jar to /foo/.m2/repository/com/xxx/utils/licm/0.2.9-SNAPSHOT/licm-0.2.9-SNAPSHOT.jar
[INFO] Installing /foo/licm/trunk/pom.xml to /foo/.m2/repository/com/xxx/utils/licm/0.2.9-SNAPSHOT/licm-0.2.9-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.8.1:deploy (default-deploy) # licm ---
Downloading: http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml
from/to Snapshots (http://xxx.xxx.com:8080/nexus/content/repositories/snapshots): Failed to transfer file:
http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/
maven-metadata.xml. Return code is: 500 , ReasonPhrase:Internal Server Error.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.824s
[INFO] Finished at: Fri Dec 20 01:20:33 CST 2013
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on project licm: Failed to retrieve remote metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml from/to Snapshots (http://xxx.xxx.com:8080/nexus/content/repositories/snapshots): Failed to transfer file: http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml. Return code is: 500 , ReasonPhrase:Internal Server Error. -> [Help 1]"
This is my first time to deploy snapshots to remote repository,so there have nothing in snapshot repository on nexus server
settings.xml
<?xml version="1.0"?>
<settings>
<servers>
<server>
<id>Releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>Snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>Nexus</id>
<name>Nexus Public Mirror</name>
<url>http://xxx.xxx.com:8080/nexus/content/groups/public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
pom.xml
<distributionManagement>
<repository>
<id>Releases</id>
<name>xxx Releases Repositories</name>
<url>http://xxx.xxx.com:8080/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>Snapshots</id>
<name>xxx Snapshots Repositories</name>
<url>http://xxx.xxx.com:8080/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
I've encountered the same return code (500) and reason (Internal server error), and finnaly found that the nexus server disk space is full. :) Checking the nexus log in the server could find this clue.
Answer myself.
When the nexus server can't find the maven-metadata.xml,it will cause tomcat throw an exception,this is the problem
I change the Tomcat version from 6.x to 7.0.x,everything is ok
Nexus requires a Servlet 3.0 compliant container. It comes bundled with a Servlet 3.0 compliant Jetty 8. If you deploy it on another container you have to make sure it is compliant. Couldn't find this in the documtation but from own experience it seems to be the case.
When you
HTTP GET
http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml
in a browser you should be able to see the stacktrace, which contains
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()
This is only available in Servlet 3.0 containers.
This was the error reported as similar in my case:
Failed to transfer file:
http://192.168.0.2:8080/repository/maven-snapshots/org/xxxx/xxx-yyy/1.0-SNAPSHOT/maven-metadata.xml.
Return code is: 500 , ReasonPhrase:Server Error.
In my case after doing the http file verification suggested by #hansi, the server response was javax.servlet.ServletException: java.lang.NumberFormatException: null.
After doing some review about what causes this, I found that is is because a problem with the artifact creation timestamp. In my case the maven-metadata.xml was corrupted and it was caused by a reboot in the server that adjusted the time automatically after the daylight saving time was in efect. I got a clue about it in this post https://issues.sonatype.org/browse/NEXUS-12496
What worked in my case was to delete the maven-metadata.xml in all the artifact references. After that the error was corrected.
In here we get failure.
Downloading: http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml
then we cant get that release snapshot so we do manually in pom.xml file
updated to related dependency details then it will work.

Unable to build sonar project. Error: Cannot find parent: org.codehaus.sonar:sonar

Trying to build our java app using sonar for analysis. We are behind a firewall so no access to maven repo1. We do have a internal corp Artifactory for third party artifacts and a project Artifactory for our local stuff. I am the SCM guy in charge of our build server, not a developer. That said the application with junit tests builds fine. We have two goals clean install. The sonar server is 3.5.1 and the port set to 8080 instead of 9000 This is in our pom.
<profile>
<id>sonarJsEnabled</id>
<properties>
<srcDir>src/main/static</srcDir>
<sonar.exclusions>libs/**/*,DSTCore/**/*,test/**/*</sonar.exclusions>
<maven.test.skip>true</maven.test.skip>
<sonar.language>js</sonar.language>
<sonar.branch>js</sonar.branch>
</properties>
</profile>
<profile>
<id>sonarHtmlEnabled</id>
<properties>
<srcDir>src/main/static</srcDir>
<sonar.language>web</sonar.language>
<sonar.branch>web</sonar.branch>
<sonar.web.fileExtensions>html,xhtml,jspf,jsp</sonar.web.fileExtensions>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- SERVER ON A REMOTE HOST -->
<sonar.host.url>http://10.226.xx.xx:8080</sonar.host.url>
</properties>
</profile>
and this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>1.0-beta-2</version>
</plugin>
We add sonar:sonar When we build manually or with Bamboo we get this output.
C:\sonartest>mvn sonar:sonar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] org.apache.maven.plugins: checking for updates from EnterpriseArchitectureRepo
[INFO] org.codehaus.mojo: checking for updates from EnterpriseArchitectureRepo
[INFO] artifact org.codehaus.mojo:sonar-maven-plugin: checking for updates from EnterpriseArchitectureRepo
[INFO] Ignoring available plugin update: 2.0 as it requires Maven version 3.0
[INFO] Ignoring available plugin update: 2.0-beta-2 as it requires Maven version 3.0
[INFO] Ignoring available plugin update: 2.0-beta-1 as it requires Maven version 3.0
[INFO] ------------------------------------------------------------------------
[INFO] Building fundTrader
[INFO] task-segment: [sonar:sonar] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar:sonar {execution: default-cli}]
[INFO] Sonar host: http://10.226.xx.xx:8080
[INFO] Sonar version: 3.5.1
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:3.5.1:sonar
Downloading: http://repository.corp.net:8080/artifactory/libs-release/org/codehaus/sonar/sonar/3.5.1/sonar-3.5.1.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar:pom:3.5.1' in repository EnterpriseArchitectureRepo (http://repository.corp.net:8080/artifactory/libs-release)
...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': Cannot find parent: org.codehaus.sonar:sonar for project: null:sonar-maven-plugin:maven-plugin:null for project null:sonar-maven-plugin:maven-plugin:null
Unable to download the artifact from any repository
Any help would be greatly apreciated.
I looks like the sonar-3.5.1.pom is not found. Consider adding Bintray's jcenter remote repository to your Artifactory (it has much more artifacts than Maven Center).
The simplest way to do it is to import the jcenter configuration from an Artifactory instance at repo.jfrog.org.
Just click on the Import -> Load and select jcenter from the list of loaded repository configurations.

Artifact downloaded, but not used from my single Nexus server

I am new to Nexus and am trying to run a Maven project against my single Nexus server. In running the project (Spring Roo example known to build and run properly), all but two milestone jar’s loaded. My answer (maybe not the best) was to find and upload the jars directly (with POM’s) into my Nexus server (hosted repo), which I then placed in the public group.
When re-running the mvn project (using mvn package tomcat:run), the 2 files seem to download (see console output below) from the server, but are still not found by the mvn project. Why would the project apparently call them down but not use them? Thanks.
Here is the console output showing the download happening, but not getting used by the project, and my settings.xml (jars at issue are the aspectjrt-1.6.11.M1 and aspectjweaver-1.6.11.M1):
Last login: Mon Nov 14 06:03:25 on console
Macintosh-2:~ wlaprise$ cd coursemanager/
Macintosh-2:coursemanager wlaprise$ mvn package tomcat:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Course Manager Chapter 4 0.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom (909 B at 0.5 KB/sec)
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom (912 B at 1.0 KB/sec)
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.annotations/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.osgi.bundle/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.root/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.jar
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar (1640 KB at 689.5 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.607s
[INFO] Finished at: Mon Nov 14 06:17:42 CST 2011
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project course-manager-chapter-04: Could not resolve dependencies for project org.rooinaction.coursemanager:course-manager-chapter-04:war:0.1.0.BUILD-SNAPSHOT: Could not find artifact org.aspectj:aspectjweaver:jar:1.6.11.M1 in nexus (http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public) -> [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
Macintosh-2:coursemanager wlaprise$
settings.xml -
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>com.sonatype.maven.plugins</pluginGroup>
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups>
</settings>
First of all the url http://central is fine. It is a dummy placeholder that is never used because you have the mirror defined.
However the mirror url you are using it most likely wrong. Typically repositories in Nexus are hosted or proxied and then aggregated into a public "group".
The url default url for the public group is http://localhost:8081/nexus/content/groups/public/
with localhost replaced with your server and the port omitted if you are proxying behind apache or running on port 80.
Anyway.. the main point is that the url is /content/GROUPS/public .. your url is most likely wrong. To test is just try the url from the mirror in a browser.
And of course all the repositories you want available in the public group have to be added to it.
Since you are running on your own Nexus server, the jar is not available on the repositories you have configured. You should add the Spring Source milestone, releases, and snapshots repository to the public group.
OSS has an instance of the Spring Source repository and they have a single group url that contains the milestone, releases, and snapshots. The link is https://oss.sonatype.org/content/groups/springsource-all/
To do that, you should add a proxy repository that points to https://oss.sonatype.org/content/groups/springsource-all/ and set the repository policy to Snapshot.
Then, add the new repository to the public group. Finally, rebuild the index and Maven should be able to find the file now.
Also, below are a few helpful links configuring Spring with Nexus.
http://www.sonatype.com/people/2009/12/spring-maven-nexus-best-practices/
http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/

Resources