Hi - I am trying to configure nexus to proxy the repo http://clojars.org/repo/.
I added this repository as a proxy repository with the above URL. I then added this proxy repository to the public group. When I did 'Browse Remote' and 'Browse Index' everything looked good.
But when I modify a very simple project to include a dependency on a .jar that resides in the aforementioned repo, I get this error: [ERROR] Failed to execute goal on project findFiles: Could not resolve dependencies for project com.lackey:findFiles:jar:1.0-SNAPSHOT: Failure to find org.clojars.brenden:storm-kafka-0.8-plus:jar:0.1.3-SNAPSHOT in http://dmip.buildserver.fairisaac.com:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
I got this error as I was experimenting with a very simple project which I created like this: mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -DarchetypeArtifactId=gmaven-archetype-basic -DgroupId=com.lackey -DartifactId=findFiles -Dpackage=com.lackey
To create my ~/.m2/settings.xml I followed these directions:
Then I wiped out my ~/.m2/repository and I verified that everything was downloading from my nexus server. Good start. Next I added a dependency on an artifact that resides in the clojars repo.
I modified my pom to include this : <dependency> <groupId>org.clojars.brenden</groupId> <artifactId>storm-kafka-0.8-plus</artifactId>
<version>0.1.3-SNAPSHOT</version> </dependency> Then I got the above error. After I got the error I tried adding the config shown below (starting at NEW
addition) to my settings XML file <profile> <id>nexus</id> <!--Enable snapshots for the built in central repo to direct -->
<!--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> <!-- NEW addition.. did not work :^( --> <repository> <id>clojars</id>
<releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository>
That did not do the trick. Right now. I'm pretty stuck on what I should do next, and would be very grateful to whoever can help me spot my dumb mistake. regards -chris possibly relevant wrapper.log output ------------------------------------ jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl - Initializing non-existing prefix file of newly added "clojars" [id=clojars]
jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.proxy.registry.DefaultRepositoryRegistry - Added repository "clojars" [id=clojars][contentClass=Maven2][mainFacet=org.sonatype.nexus.proxy.maven.MavenProxyRepository]
jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration made by admin... jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration made by admin...
jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.tasks.UpdateIndexTask - Scheduled task (UpdateIndexTask) started :: Updating repository index "clojars" from path null and below.
jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Trying to get remote index for repository "clojars" [id=clojars] jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.proxy.storage.remote.httpclient.HttpClientRemoteStorage - Initializing remote transport for proxy repository "clojars" [id=clojars]...
jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Cannot incrementally update index for repository clojars jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Unable to incrementally update index for repository clojars. Trying full index update
jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Trying to get remote index for repository "clojars" [id=clojars] jvm 1 | 2013-12-13 23:11:53 INFO [ar-4-thread-4] admin org.sonatype.nexus.proxy.maven.routing.internal.RemoteScrapeStrategy - Not possible remote scrape of M2Repository(id=clojars), no scraper succeeded.
jvm 1 | 2013-12-13 23:11:55 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Remote indexes updated successfully for repository "clojars" [id=clojars] Chris Bedford
Founder & Lead Lackey Build Lackey Labs: http://buildlackey.com Go Grails!: http://blog.buildlackey.com |
you might have to create two proxies, one for releases, and one
for snapshots.
I did this and it worked okay. be sure to clear your local
maven cache between experiments (rm -rf
.m2/repository/org/clojars).
you don't need any additional lines in settings.xml.
At 10:33 PM -0800 12/13/13, Chris Bedford wrote:
Hi - I am trying to configure nexus to proxy the repo http://clojars.org/repo/. I added this repository as a proxy repository with the above URL. I then added this proxy repository to the public group. When I did 'Browse Remote' and 'Browse Index' everything looked good. But when I modify a very simple project to include a dependency on a .jar that resides in the aforementioned repo, I get this error: [ERROR] Failed to execute goal on project findFiles: Could not resolve dependencies for project com.lackey:findFiles:jar:1.0-SNAPSHOT: Failure to find org.clojars.brenden:storm-kafka-0.8-plus:jar:0.1.3-SNAPSHOT in http://dmip.buildserver.fairisaac.com:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1] I got this error as I was experimenting with a very simple project which I created like this: mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -DarchetypeArtifactId=gmaven-archetype-basic -DgroupId=com.lackey -DartifactId=findFiles -Dpackage=com.lackey To create my ~/.m2/settings.xml I followed these directions:
Then I wiped out my ~/.m2/repository and I verified that everything was downloading from my nexus server. Good start. Next I added a dependency on an artifact that resides in the clojars repo. I modified my pom to include this : <dependency> <groupId>org.clojars.brenden</groupId> <artifactId>storm-kafka-0.8-plus</artifactId> <version>0.1.3-SNAPSHOT</version> </dependency> Then I got the above error. After I got the error I tried adding the config shown below (starting at NEW addition) to my settings XML file <profile> <id>nexus</id> <!--Enable snapshots for the built in central repo to direct --> <!--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> <!-- NEW addition.. did not work :^( --> <repository> <id>clojars</id> <url>http://dmip.buildserver.fairisaac.com:8081/nexus/content/repositories/clojars/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> That did not do the trick. Right now. I'm pretty stuck on what I should do next, and would be very grateful to whoever can help me spot my dumb mistake. regards -chris possibly relevant wrapper.log output ------------------------------------ jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl - Initializing non-existing prefix file of newly added "clojars" [id=clojars] jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.proxy.registry.DefaultRepositoryRegistry - Added repository "clojars" [id=clojars][contentClass=Maven2][mainFacet=org.sonatype.nexus.proxy.maven.MavenProxyRepository] jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration made by admin... jvm 1 | 2013-12-13 23:11:49 INFO [qtp1178447098-37] admin org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration made by admin... jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.tasks.UpdateIndexTask - Scheduled task (UpdateIndexTask) started :: Updating repository index "clojars" from path null and below. jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Trying to get remote index for repository "clojars" [id=clojars] jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.proxy.storage.remote.httpclient.HttpClientRemoteStorage - Initializing remote transport for proxy repository "clojars" [id=clojars]... jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Cannot incrementally update index for repository clojars jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Unable to incrementally update index for repository clojars. Trying full index update jvm 1 | 2013-12-13 23:11:50 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Trying to get remote index for repository "clojars" [id=clojars] jvm 1 | 2013-12-13 23:11:53 INFO [ar-4-thread-4] admin org.sonatype.nexus.proxy.maven.routing.internal.RemoteScrapeStrategy - Not possible remote scrape of M2Repository(id=clojars), no scraper succeeded. jvm 1 | 2013-12-13 23:11:55 INFO [pxpool-1-thread-1] admin org.sonatype.nexus.index.DefaultIndexerManager - Remote indexes updated successfully for repository "clojars" [id=clojars] -- Chris Bedford |
In reply to this post by Chris Bedford
The answer I got from Russ Tremain
was spot on. I didn't do exactly what Russ suggested.. but i did notice that I was referencing a snapshot dependency, whereas I had registered clojars as a release repo. I changed the "policy" setting to snapshot... whacked my ~/.m2/repository directory to start fresh, and the build succeeded.
Thank you, Russ. -chris On Fri, Dec 13, 2013 at 10:33 PM, Chris Bedford <[hidden email]> wrote:
Chris Bedford
Founder & Lead Lackey Build Lackey Labs: http://buildlackey.com Go Grails!: http://blog.buildlackey.com |
good to know, Chris.
The tool hint in the nexus config says:
Because the remote in this case includes both snapshots and
releases, by setting your policy to snapshots, it seems that the proxy
is picking up both. so perhaps "release" policy really
means " include releases but exclude snapshots", and
snapshot policy means "include releases and
snapshots".
Perhaps one of the experts at Sonatype could clarify...
-Russ
At 3:21 PM -0800 12/15/13, Chris Bedford wrote:
The answer I got from Russ Tremain was spot on. I didn't do exactly what Russ suggested.. but i did notice that I was referencing a snapshot dependency, whereas I had registered clojars as a release repo. I changed the "policy" setting to snapshot... whacked my ~/.m2/repository directory to start fresh, and the build succeeded. Thank you, Russ. -chris On Fri, Dec 13, 2013 at 10:33 PM, Chris Bedford <[hidden email]> wrote: -- Chris Bedford |
Snapshot proxies only allow snapshots, and release proxies only allow releases.
But maven-metadata.xml files at the GA level are neither snapshots nor releases, so they are always allowed through. Because you did not specify a version in your archetype:generate Maven downloaded this file to find highest version: com/lackey/findFiles/maven-metadata.xml The highest version was a snapshot, and then Maven tried to download: com/lackey/findFiles/1.0-SNAPSHOT/maven-metadata.xml This was rejected, because it didn't match the proxy's policy. Rich On Dec 16, 2013, at 11:23 AM, Russ Tremain <[hidden email]> wrote:
|
so what is the bottom line best practice for proxying mixed
remote repositories?
Also, by "GA" level, I assume you mean the
group-artifact level of the remote?
At 12:11 PM -0600 12/16/13, Richard Seddon wrote:
Snapshot proxies only allow snapshots, and release proxies only allow releases. But maven-metadata.xml files at the GA level are neither snapshots nor releases, so they are always allowed through. Because you did not specify a version in your archetype:generate Maven downloaded this file to find highest version: com/lackey/findFiles/maven-metadata.xml The highest version was a snapshot, and then Maven tried to download: com/lackey/findFiles/1.0-SNAPSHOT/maven-metadata.xml This was rejected, because it didn't match the proxy's policy. Rich On Dec 16, 2013, at 11:23 AM, Russ Tremain <[hidden email]> wrote:
|
On Dec 16, 2013, at 12:38 PM, Russ Tremain <[hidden email]> wrote:
Rich
|
Free forum by Nabble | Edit this page |