views:

23

answers:

2

Hi,

I'm running the maven repository manager Nexus on Tomcat. When I setup my pom file, my repository URLs all look something like http://myhost/nexus/repo-name. I'd like to get the word "nexus" out of the URL. We're currently transitioning from an older repository manager and now we need to update all of the URLs. However, if we had a generic repository URL like http://myhost/maven-repo/repo-name, then the URL would be independent of the repository manager.

How can I set something like this up on Tomcat? Would I need to setup host name aliases? Or is there an easier way to do this?

Thanks, Jeff

+1  A: 

I would use a frontal Apache server (only httpd, not Tomcat) to do that, configured as a reverse proxy.

Apache url rewriting and reverse proxy are easy to configure. With this Apache frontal proxy, you are independant from Nexus, but also from the Tomcat server.

With the same Apache URL, you can move to Archiva on a Glassfish server (for example) transparently for the projects.

Benoit Courtine
I don't administer the server, so this might be a little tougher in my place. I can have the server configuration files modified but using a frontal apache server probably isn't feasible in my case, although a reasonable solution.
Jeff Storey
A: 

I hope you don't put repository locations into your pom's? You should use settings.xml file instead.

khmarbaise
The main problem I have with putting repositories in the settings is that a developer cannot build without that settings.xml. By putting the repository locations in the pom, all the developer needs to do is pull the code and build from there. There are pros and cons to having the repository info in the pom or the settings.xml, and without getting into too much detail, in our situation, it actually works better to have it in the pom.
Jeff Storey
The best solution for such a problem is to install a repository manager (Nexus, Archiva, Artifactory) and solve this there.
khmarbaise