Nexus: Configure jarvana as a remote repository -- what's the URL? - maven-2

I'm converting an Ant build system to use a local Nexus mirror (1.3.6), and can't seem to get Nexus to proxy Jarvana repository. One of our dependencies is jython 2.5, which is available only on Jarvana.
I had no problem configuring other repository proxies, such as java.net at http://download.java.net/maven/2/
For Jarvana I've tried
www.jarvana.com/
www.jarvana.com/jarvana/
www.jarvana.com/maven2/
www.jarvana.com/maven/2/
www.jarvana.com/browse/
In all cases, the browse pane shows .index and .meta folders, and the .index is populated with nexus-maven-repository-index-* files, but searching for jython returns only the earlier (2.2 and prior) versions from Maven Central.
Am I using the wrong URL, and if so what URL should I be using?

Jarvana offers maven repository search capabilities and maven repository browse capabilities, but it does not offer a direct URL for its repository files. This is because all Jarvana files come from the maven central repository, so every file in Jarvana should be available in the maven central repository.
As an example, Jython 2.5 is available in the central repository at:
repo1.maven.org/maven2/org/python/jython/2.5.0/

Update: I did a bit more digging and it looks like the repository URL for Jarvana is http://www.jarvana.com/jarvana/browse. I've just added Jarvana as a proxy repository with that URL and successfully downloaded Jython 2.5.

Related

Artifactory ignores artifacts deployed into libs-release-local

We are evaluating Artifactory to be used as our local/remote repository. Our application uses a custom cxf-2.6.6 jar. We've manually deployed the cxf jar into libs-release-local. But each time we do a local build, Artifactory downloads a version of cxf 2.6.6 from the remote maven repository into ext-release-local. As a result there will be two copies of cxf 2.6.6.jar and unfortunately our local build uses only the downloaded cxf instead of the one we deployed.
Both libs-release-local & ext-release-local are mapped to the same virtual repository libs-release, so this is strange. Even if I delete the cxf from ext-release-local it downloads again. How do I restrict this? I could probably deploy the cxf into ext-release-local (I haven't tried)?
But then isn't it a bug? Please advice.
You can control the resolution order of a virtual repository: Admin -> Repositories -> Edit (Virtual repository) -> Drag & drop repository names in the "Selected Repositories" box.
The "Resolved Repositories" box will reflect the order in which the resolution is performed.
Generaly speaking the search/resolution order when requesting artifacts from a virtual repository is always: local repositories, remote repository caches and finally remote repositories themselves.
If you are using Artifactory 2.6.0 or newer, you can use the Trace Artifact Retrieval feature to emulate an artifact retrieval request from the specified location and returns verbose output about the resolution process.

Forcing Maven2 to download source jars to local repository

I have my company dependencies (including non-FOSS third party stuff) in a Nexus repository, including source jars (downloaded with mvn dependency:resolve), where available.
I would like to have the source jars (and javadoc jars) download to my local repository (~/.m2/repository) so that I can go "offline".
I tried various combinations of mvn dependency:resolve dependency:go-offline -Dclassifier=sources, but it does not seem to copy them to my local repository.
Thanks.
Did you try:
mvn dependency:sources

How can I get nexus to proxy springsource maven repository on s3?

I have nexus 1.5.0 setup to proxy springsource repositories but it's not working. The repositories are on s3 that nexus doesn't seem to understand how to deal with that.
What's the right pattern?
Here are the repositories I'm told I need, but I cannot access the maven paths with in them
http://repository.springsource.com/maven/bundles/release
http://repository.springsource.com/maven/bundles/external
Do, I need to mirror these locally?
According to NEXUS-1121, your version of Nexus knows how to deal with S3 based repositories. Below, Eugene's comment:
Here is Nexus setup that works for me:
Configured "proxy" repository for http://repository.springsource.com/maven/bundles/release
Configured "proxy" repository for http://repository.springsource.com/maven/bundles/external
Added both of those repositories into default "Public Repositories" group
After that I am able to download
artifacts from those repositories as
if they are in Maven Central
repository.
The only issue is that you can only
search trough artifacts that been
proxied, because there is no Nexus
index published on those repositories.
It should be easy to publish index and
instructions for using standalone
indexer can be found at
http://docs.codehaus.org/display/M2ECLIPSE/Nexus+Indexer#NexusIndexer-indexer
It works for me with this configuration and with another repository.
I have a Sonatype Nexus repository version 1.9.1.1. I wanted to configure the repositories to download artifacts from http://maven.springframework.org/milestone/.
I have created a new proxy repository with this configuration:
id: repository.springframework.maven.milestone
Name: Spring Maven Milestone Repository
Rep. Type: proxy
Provider: Maven2
Format: Maven2
Rep Policy: Release
Remote storage: http://maven.springframework.org/milestone/
Down. Remote indexes: false
Auto blocking: true
File validation: False
Checksum: warm.
I saved the data and the repository was created.
The strange thing is that when i try to use the "browse Remote" tab I can't list anything.
Important: After that I clicked on Public Repositories / Configuration and added the Spring Maven Milestone Repository to the ordered group repositories.
And finally, I wrote the dependency in my POM archive:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.0.0.RC1</version>
</dependency>
And it was downloaded without problems.
I hope it will be useful.

Maven downloads corrupted Jars

I am running into a maven problem that's killing all my hairs.
So at the beginning all my maven project works fine. And then when I switched to a new computer today and trying to compile them all.
The first error I see from Eclipse is IO error reading jar files from the local maven repository. Then I googled and someone suggested this is some corrupted files, simply delete them and let maven rebuild the repository.
That solves the problem for a while. And then it keeps popping up again and again.
I got tired and removed the whole local repository and did everything all over again. Then I found out the cause:
The maven remote repository is BAD.
So here is part of the console messages.
[INFO] Unable to find resource 'org.apache.ws.commons.axiom:axiom-dom:jar:1.2.8'
in repository eclipse-repo (http://repo1.maven.org/eclipse)
Downloading: https://maven-repository.dev.java.net/nonav/repository//org.apache.
ws.commons.axiom/jars/axiom-dom-1.2.8.jar
373b downloaded (axiom-dom-1.2.8.jar)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '2c6102c2c3
70e0b993e897e981618ed448651147'; remote = '
The file contains an http redirect.
301 Moved Permanently
Moved Permanently
The document has moved here.
Apache Server at maven-repository.dev.java.net Port 443
I am stuck. How can I get the real dependency jars? How can I tell maven to avoid this? This is really annoying.
There is king of bug in maven, simply because maven does not skip taking an artifact if one
of the maven repo sends a 301(MOVED PERMANANTLY) and it simply take that message and write it as the pom file. Simply if the maven repo sends 404 it skip that repo and go for another, but here with 301 it just dump the message as the pom file and later on this failes.
I assuming you're using Maven 2.2.1? If yes try, to downgrade to Maven 2.2.0 or use additional setting. In 2.2.1 was change in wagon implementation.
Maven 2.2.1 aims to correct several critical regressions related to the selection of the HttpClient-based Wagon implementation for HTTP/HTTPS transfers in Maven 2.2.0. The new release reverts this selection, reinstating the Sun-based - or lightweight - Wagon implementation as the default for this sort of traffic.
However, Maven 2.2.1 goes a step further to provide a means of selecting which provider - or implementation - the user wishes to use for a particular transfer protocol.
So, try run maven with additional params.
mvn -Dmaven.wagon.provider.http=httpclient clean install
One answer: avoid dev.java.net. It's often broken in one way or the other. If you need things from there, install them in a local repository manager.
I've seen this error with IntelliJ IDEA 13.1.5 and Ubuntu 14.04.
Maven 2.2.? saves the 301 response body as a jar file in the ~/.m2 cache, which causes problems later on during the build.
The fix for me was to install Maven 3. Instructions for Ubuntu 14.04 are here:
http://www.sysads.co.uk/2014/05/install-apache-maven-3-2-1-ubuntu-14-04/

How do I set up the JBoss Maven repository in NetBeans 6.5?

I tried to configure the Maven plug in (version 4) to add the JBoss Maven repository at http://repository.jboss.com/maven2/ following the guide at http://wiki.netbeans.org/MavenBestPractices#section-MavenBestPractices-UtilizingAndManagingMavenRepositories.
The new repository appears in the list of Maven repositories, but I can not see any items (artifacts), updating the index does not help.
It looks like a problem with the Maven plug in. Maybe it requires an ".index" subdirectory which is not available on the JBoss server.
The JBoss repository has a Nexus index at http://repository.jboss.com/maven2/.index/. I think the problem is that Netbeans might not be making use of this index. I would recommend installing Nexus, adding the JBoss repo to a public group and then pointing your Netbeans instance at a local instance of Nexus.
Download Nexus from http://nexus.sonatype.org
Install it by unpacking the tar.gz or zip on your machine
Fire it up by running bin/jsw//nexus start
Go to http://localhost:8081/nexus
Log in as the default admin user: admin/admin123 is the username/password
Click on Repositories
Click the Add... button
Add a new repository for the JBoss repositorywith a remote location of: http://repository.jboss.com/maven2/
Save the new repository. (You will also want to make sure that Download remote index is selected)
Add the repository to your public group by clicking on the public group and dragging the new JBoss repository to the selected repositories.
Configure your ~/.m2/settings.xml file to have the same contents as: http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html
At that point, all of your repository requests are going to flow through Nexus. Nexus already ships with proxy repositories for Central. So all you did was to add in the JBoss repository and then add it to the public group. Once you do this, you'll find that your builds are going to be much, much faster.