Reputation: 828
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>
Upvotes: 3
Views: 774
Reputation: 489
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/
Upvotes: 0
Reputation: 29912
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.
Upvotes: 1