Maven dependency for jira-rest-java-client-0.2-m1.jar - maven

I want to download jira-rest-java-client-0.2-m1.jar using maven. But I dont know the dependency for that.
I tried the following
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client</artifactId>
<version>0.2-m1</version>
</dependency>
But it is not downloading. When I run mvn compile it says
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.444s
[INFO] Finished at: Thu May 02 09:53:19 IST 2013
[INFO] Final Memory: 7M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for project com.package.myproject:myproject:war:1.0-SNAPSHOT
: Failure to find com.atlassian.jira:jira-rest-java-client:jar:0.2-m1 in http://repository.codehaus.org was cached in the local repository, resolu
tion will not be reattempted until the update interval of codehaus-release-repo has elapsed or updates are forced -> [Help 1]
Manually I am able to download the jar. But I want to download it using maven. How can I do that?
Thanks

Looks like you can probably just add Atlassian's public repo to your settings.xml or your pom.xml.
From: https://developer.atlassian.com/display/DOCS/Atlassian+Maven+Repositories,
the url for the public repo is http://maven.atlassian.com/public
Google searches also suggest this repo URL might work as well: https://repository.atlassian.com/maven2
For example to add to your project's pom.xml,
you would add the following as a child of <project>:
<repositories>
<repository>
<id>central</id>
<name>Atlassian Public Repository</name>
<layout>default</layout>
<url>http://maven.atlassian.com/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
(If you already have a repositories section, then you would just add the repository to it).
Here is the documentation for the pom if you would like a little more info: http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

Related

Restlet maven dependency issue error code 307

I have the following Restlet dependency that is probably coming into effect because its transitive in nature.
However I get the following error message which stops me from building the project. Can you please let me know the issue?
Failed to read artifact descriptor for org.restlet.jee:org.restlet:jar:2.1.1: Could not transfer artifact org.restlet.jee:org.restlet:pom:2.1.1 from/to maven-restlet (http://maven.restlet.org): Failed to transfer http://maven.restlet.org/org/restlet/jee/org.restlet/2.1.1/org.restlet-2.1.1.pom. Error code 307, Temporary Redirect -> [Help 1]
I made a try with the version of Restlet you use (2.1.1) and same edition (jee) with the following file pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.restlet.maven</groupId>
<artifactId>org.restlet.maven.test</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>
<version>1.0.0-snapshot</version>
<dependencies>
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.com</url>
</repository>
</repositories>
</project>
I works for me. See the following traces below:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.restlet.maven.test 1.0.0-snapshot
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.restlet.com/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
Downloaded: http://maven.restlet.com/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom (614 B at 1.0 KB/sec)
Downloading: http://maven.restlet.com/org/restlet/jse/org.restlet.parent/2.1.1/org.restlet.parent-2.1.1.pom
Downloaded: http://maven.restlet.com/org/restlet/jse/org.restlet.parent/2.1.1/org.restlet.parent-2.1.1.pom (9 KB at 28.7 KB/sec)
Downloading: http://maven.restlet.com/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.jar
Downloaded: http://maven.restlet.com/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.jar (710 KB at 392.9 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # org.restlet.maven.test ---
(...)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.353s
[INFO] Finished at: Wed Feb 25 10:48:47 CET 2015
[INFO] Final Memory: 11M/213M
[INFO] ------------------------------------------------------------------------
I think that it's a problem in your maven configuration.
Hope it helps you,
Thierry
Are you able to go beyond the compilation error?. I'm getting this error while including Morphline dependency for building a Morphline ETL job. After investigating I was not able to get an answer. I manually downloaded the pom, jar into the .m2 directory on my location and fix this issue.
I downloaded the files from http://maven.restlet.com/org/restlet/jee/org.restlet.parent/2.1.1/.
built the pom and it was successful. let me know if there was a fix to this issue which is automatic.
The problem is that whatever is calling the restlet dependency in the original question is referencing http://maven.restlet.org which doesn't seem to be a good URL anymore (and it looks like it was in transition when the question was asked). It should work if you replace that with http://maven.restlet.com, which bears out in Thierry's answer.
Incidentally, I came across this same issue while trying to install DSpace 6.3, which has a dependency of Solr 4.10.4, and I want to share my solution in case others are encountering this and, like me, finding only very old and irrelevant threads about it.
My error message was almost identical except for the message returned by the server:
[ERROR] Failed to execute goal on project dspace-solr: Could not resolve
dependencies for project org.dspace:dspace-solr:war:6.3: Failed to collect
dependencies at org.apache.solr:solr-core:jar:4.10.4 ->
org.restlet.jee:org.restlet:jar:2.1.1: Failed to read artifact descriptor for
org.restlet.jee:org.restlet:jar:2.1.1: Could not transfer artifact
org.restlet.jee:org.restlet:pom:2.1.1 from/to maven-restlet
(http://maven.restlet.org): Access denied to:
http://maven.restlet.org/org/restlet/jee/org.restlet/2.1.1/org.restlet-2.1.1.pom ,
ReasonPhrase:Forbidden. -> [Help 1]
I resolved this by searching for .pom files in my ~/.m2 directory that contained "restlet.org" and then editing them to replace restlet.org with restlet.com, which for the version of Solr that DSpace needs was in:
~/.m2/repository/org/apache/solr/solr-parent/4.10.4/solr-parent-4.10.4.pom
And I changed from
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.org</url>
</repository>
To
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.com</url>
</repository>
For anyone facing the below issue with restlet jse download from maven,
Could not resolve dependencies for project restletapi:restlet-sample-project:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.restlet.jse:org.restlet:jar:2.3.7: Failed to read artifact descriptor for org.restlet.jse:org.restlet:jar:2.3.7: Could not transfer artifact org.restlet.jse:org.restlet:pom:2.3.7 from/to maven-restlet (https://maven.restlet.com): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
You need to add the below Restlet respository in pom.xml
<repositories>
<repository>
<id>maven-restlet</id>
<name>Restlet repository</name>
<url>https://maven.restlet.talend.com</url>
</repository>
</repositories>

Maven cannot download from Artifactory Repository

I am attempting to connect our Jenkins servers to our Artifactory repository for builds. I've been successful with the Jenkins server at my office location, but I am having problems with a Jenkins server that's on another part of the corporate network.
I've disabled the job, went into the workspace, and tried using mvn directly:
$ mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PROJ Generic Aggregate POM
[INFO] PROJ Generic Module
[INFO] PROJ Generic Features
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PROJ Generic Aggregate POM 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
And then it freezes before it spits out:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PROJ Generic Aggregate POM ........................ FAILURE [2:06.295s]
[INFO] PROJ Generic Module ............................... SKIPPED
[INFO] PROJ Generic Features ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:07.160s
[INFO] Finished at: Wed Feb 11 18:16:46 EST 2015
[INFO] Final Memory: 8M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.vegicorp.net/artifactory/plugins-release): Connection to http://repo.vegicorp.net refused: Connection timed out -> [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/PluginResolutionException
to
However, if I attempt to fetch that URL via curl, it downloads without any problems. Same with wget:
$ curl http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
<?xml version='1.0' encoding='UTF-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
So, I am able to reach that URL via wget and curl, but Maven itself seems to be having problems fetching that URL. I've added a proxy settings to my ~/.m2/settings.xml, but that doesn't seem to make any difference. We originally setup our Maven repository to redirect from Port 80 to Port 8080, but adding or removing the port number from the URL makes no difference. The settings.xml is from Artifactory which will generate it for you. The same settings.xml works in our office.
Removing the settings.xml allows everything to work because it can download from the standard Maven repo.
My settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>dweintraub</username>
<password>AP8SoMtGnYpACsAwZo5oqUCfSYP</password>
<id>central</id>
</server>
<server>
<username>dweintraub</username>
<password>AP8SoMtGnYpACsAwZo5oqUCfSYP</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://repo.vegicorp.net/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://repo.vegicorp.net/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://repo.vegicorp.net/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
And there's a file ~/.m2/repositories/org/apache/maven/plugins/maven-clean-plugins/2.4.1/maven-clean-plugin-2.4.1.pom.lastUpdated with this content:
#NOTE: This is an internal implementation file, its format can be changed without prior notice.
#Wed Feb 11 18:16:46 EST 2015
da39a3ee5e6b4b0d3255bfef95601890afd80709#proxy.gain.tcprod.local\:3128>2f606e371a64780e100321226a9f68a38c8b7906#default-http\://repo.vegicorp.net/artifactory/plugins-release/.lastUpdated=1423695463870
2f606e371a64780e100321226a9f68a38c8b7906#default-http\://repo.vegicorp.net/artifactory/plugins-release/.lastUpdated=1423696543392
http\://repo.vegicorp.net/artifactory/plugins-release/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to central (http\://repo.vegicorp.net/artifactory/plugins-release)\: Connection to http\://repo.vegicorp.net refused
http\://repo.fusesource.com/nexus/content/repositories/releases/.lastUpdated=1423694766347
http\://repo.vegicorp.net/artifactory/plugins-snapshot/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to snapshots (http\://repo.vegicorp.net/artifactory/plugins-snapshot)\: Connection to http\://repo.vegicorp.net refused
2f606e371a64780e100321226a9f68a38c8b7906#default-http\://repo.vegicorp.net/artifactory/plugins-snapshot/.lastUpdated=1423696606400
http\://repo.fusesource.com/nexus/content/repositories/releases/.error=
http\://repo.vegicorp.net/artifactory/plugins-release/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to central (http\://repo.vegicorp.net/artifactory/plugins-release)\: Failed to transfer file\: http\://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is\: 504 , ReasonPhrase\:Gateway Time-out.
That looks like a proxy settings problem. Can you please add the ouptut of mvn help:effective-settings to the question? Thanks!
I'm going to cry...
$ mvn help:effective-settings
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PROJ Generic Aggregate POM
[INFO] PROJ Generic Module
[INFO] PROJ Generic Features
Downloading: http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
Downloading: http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
and then it freezes and displays:
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Sorry. I can't run mvn help:effective-settings because of my settings...
Yet I don't know why, but after i restarted the nexus process, even before it truly started, maven download process continued.......
my environment: centos 7 , maven 3.6.3, java-1.8.0-openjdk-1.8.0.302

Error running Spring-Boot samples

I've just cloned the github repo for Spring Boot samples, and I am trying to run various samples but they all return the same error:
c:\temp\spring-boot\spring-boot-samples\spring-boot-sample-web-jsp>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot Web JSP Sample 1.2.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.springframework.boot:spring-boot-maven-plugin:jar:1.2.0.BUILD-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.197s
[INFO] Finished at: Fri Aug 29 11:57:22 BST 2014
[INFO] Final Memory: 3M/183M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:1.2.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Failed to read
artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:1.2.0.BUILD-SNAPSHOT: Could not find artifact org.springframework.boot:
spring-boot-maven-plugin:pom:1.2.0.BUILD-SNAPSHOT -> [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/PluginResolutionException
Have I missed anything? Do I need to add a repo for Spring Boot? The only Spring Boot artifacts in the main maven repo are all 1.1.5.RELEASE. If I replace 1.2.0.BUILD-SNAPSHOT with 1.1.5.RELEASE, it builds; but then unsurprisingly fails to run.
I ran into the same problem when I updated from 1.1.5.RELEASE.
I ran mvn install from the spring-boot directory.
It took over 1 hour 10 minutes!
Let me know if this fixes it!
Did you have the pom file pointing to the snapshot repo as in this link? The repo link has the maven plugin contents listed.
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>

Why does maven build fails on dowloading itext from incorrect repo?

I am downloading certain dependency from external repository. So I have added following repository tag to my pom.xml
<repository>
<id>cdatoolsrelease</id>
<name>cdatools.com-releases</name>
<url>http://www.cdatools.com:8081/artifactory/ext-release-local</url>
</repository>
<repository>
<id>cdatoolssnapshot</id>
<name>cdatools.com-snapshot</name>
<url>http://www.cdatools.com:8081/artifactory/libs-snapshot-local</url>
</repository>
Everything works well. I can see my required dependencies downloaded as well. But when I try to build this project i get following exception and build fails\
D:\WORKSPACE\some-project>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count
of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building some-project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://www.cdatools.com:8081/artifactory/libs-snapshot-local/com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.122 s
[INFO] Finished at: 2014-07-17T11:53:53+05:45
[INFO] Final Memory: 10M/246M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project some-project: Could not resolve dependencies for project ProjectName:some-project:war:0.0.1-SNAPSHOT: Failed to collect dependencies at net.sf.jasperrepor
ts:jasperreports:jar:5.1.2 -> com.lowagie:itext:jar:2.1.7.js2: Failed to read artifact descriptor for com.lowagie:itext:jar:2.
1.7.js2: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js2 from/to cdatoolssnapshot (http://www.cdatools.com:8081/ar
tifactory/libs-snapshot-local): Failed to transfer file: http://www.cdatools.com:8081/artifactory/libs-snapshot-local/com/lowa
gie/itext/2.1.7.js2/itext-2.1.7.js2.pom. Return code is: 409 , ReasonPhrase:The repository 'libs-snapshot-local' rejected the
artifact 'libs-snapshot-local:com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.pom' due to its snapshot/release handling policy.. -
> [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
I don't have itext dependency in my pom file but I do have jasper dependency.
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.1.2</version>
</dependency>
Maven is trying to search itext dependency in cdatools repo but in case it does not get it maven build fails. How can i make it work. When I remove the repo everything works well as it was originally before I added new repo tag
I resolved this problem adding 2 repositories in pom.xml:
<repository>
<id>jasper</id>
<url>http://jasperreports.sourceforge.net/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jasper1</id>
<url>http://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-repo/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

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