views:

3720

answers:

1

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.

+5  A: 

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.

  1. Download Nexus from http://nexus.sonatype.org

  2. Install it by unpacking the tar.gz or zip on your machine

  3. Fire it up by running bin/jsw//nexus start

  4. Go to http://localhost:8081/nexus

  5. Log in as the default admin user: admin/admin123 is the username/password

  6. Click on Repositories

  7. Click the Add... button

  8. Add a new repository for the JBoss repositorywith a remote location of: http://repository.jboss.com/maven2/

  9. Save the new repository. (You will also want to make sure that Download remote index is selected)

  10. Add the repository to your public group by clicking on the public group and dragging the new JBoss repository to the selected repositories.

  11. 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.

tobrien
Many thanks for your great 'step by step' guide! It actually works in NetBeans without installing Nexus, my problem was that the .index directory under http://repository.jboss.com/maven2/ is hidden - so I could not see it. I will install also Nexus in the office soon for our developers.
mjustin