1

We are using SVN as a Maven Repositary. We knew that it isn't advisable to have SVN backed maven repository, but still we have to go with it due to limitation within our organization. SVN backed repository used currently is partially implemented.We have developers working from two different geographical location. Problem we face now is whenever a developer adds a artifact to maven repo(svn repository) all other developers have to update the local svn view manually to get the newly added artifact before we do mvn clean package.

IS there a way to automatically download the artifact from svn maven repository to local repo if the artifact doesn't exists locally?

SVN is hosted with a webserver so maven repositary is accessed using HTTPS protocol only. We use maven 2.2 version.

I tried with wagon plugin which would deploy the build output(jar\war) to scm directly. We are not interested in deploying the build outputs. We need a solution to download artifacts automatically from svn maven repo if it isn't exists locally?

Arunkumar
  • 61
  • 2

1 Answers1

2

You make no mention of how your SVN repository exposes it's artifacts to the development teams. If it truly a Maven repository (conforming to the standard Maven repository layout) then you could just specify it's URL in the "repositories" section of your POM. Updating the local repo would then no longer be necessary.

I suspect that what you have checked into subversion is not a Maven repository layout? You'd lose one of the key benefits of using subversion if each new version of an artifact was being checked in as a new file....

You are describing the functionality offered by any Maven repository manager, for example: Nexus. I understand your reluctance to embrace a new repository technology, but SCM systems like subversion are primarily designed for tracking changes to textual files.

In conclusion, if you truly wish to keep subversion in the loop I'd suggest one of two options:

  1. Use subversion to control the contents of the local repository. (3rd party dependencies and the artifacts generated by the developers)
  2. Use a repository manager like Nexus. Let Nexus manage cached content from external repositories, but commit the contents of locally hosted repositories into Subversion.
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • We maintain 3rd party dependencies & few artifacts in SVN backed maven repo. Whenever there a new dependency is added to project all developera are required update the svn local copy manually. SVN maven repo is accessed thru https. – Arunkumar Aug 11 '11 at 02:41
  • We maintain 3rd party dependencies & few artifacts in SVN backed maven repo. All dependency & artifacts are checked in , with default directory layout which maven expects. Tried adding svn maven repo url in repository tag with required credentials, but while build it gave error couldn't find resource error. SVN maven repo is accessed thru https. We have no plans of using nexus or artifactory repositories as now. Need a solution to update svn local copy of maven repo(3rd party binaries) automatically while build if a dependency doesn't exists. – Arunkumar Aug 11 '11 at 02:53
  • Perhaps you'd be better served by switching away from Maven entirely if you're not prepared to use a Maven repository manager. I can suggest using the ivy plugin for ANT to manage dependencies. Interestingly ivy has a resolver that enables you to store artifacts in Subversion. See http://code.google.com/p/ivysvn/ – Mark O'Connor Aug 18 '11 at 04:27