2

I'm using Eclipse to manage my SVN repository, and I have a few projects that depend on the same Jar files, I would like to create a maven artifact of these Jars (if possible using Eclipse) and commit that artifact into my SVN repository for further use.
How can I achieve that?

Thanks,
Adam.

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
TacB0sS
  • 10,106
  • 12
  • 75
  • 118

3 Answers3

2

Create an Eclipse project which contains all the JARs and an ANT build.xml which calls mvn file:install for each JAR to install then in your local Maven repository (see the docs for options of mvn file:install).

That way, you can use these JARs like any other Maven dependency after running the build.xml once.

[EDIT] A sample target would look like this:

<target name="maven-file-install">
  <exec executable="mvn"> <!-- Make sure mvn is in the PATH -->
    <arg value="file:install"/>
    <arg value="-Dfile=your-artifact-1.0.jar"/>
    ... all the other arguments of file:install ...
  </exec>
</target>
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I do understand what I need to do, but I have never used maven in the XML form, so I actually don't know hoe the build.xml should look like, could you add a short example please, I'm sure I'll be able to take it from there... Thanks. – TacB0sS Jul 15 '10 at 20:10
  • 1
    It's really simple; I've added an example. – Aaron Digulla Jul 16 '10 at 08:35
1

I suggest using a file based repository:

  • Create a module containing a file based repository
  • Install the jars in this file based repository
  • Commit the module to SVN

Detailed steps are provided in this previous answer.

Similar questions

Community
  • 1
  • 1
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
0

mvn install:install-file did the trick: Install-File

TacB0sS
  • 10,106
  • 12
  • 75
  • 118