ITeye博客

Google Code personal maven repository

cjx186 · 2012-12-28 11:59 · java · 开发实用备用资料 · 编程语言 · Markdown

Getting your jar of a library or something to other people can be expensive in terms of time. So you probably have already had a look at the maven central repository guide ... and that is too expensive to set up unless you are a big company. I did the same and I left the argument for a couple of day until I played with maven gae plugin and I saw that it was exposing versions through google code!!! This is cool, no trouble of any sort at all, no restriction... So how it works though? Easy there are just a few things to look over in your maven pom thanks to the Wagon WebDAV plugin... these are the steps

  1. add extension to the build
  2. register the repository
  3. credential in settings.xml
<extensions>
  <extension>
    <groupId>org.jvnet.wagon-svn</groupId>
    <artifactId>wagon-svn</artifactId>
    <version>1.9</version>
  </extension>
</extensions>
<distributionManagement>
  <repository>
    <id>maven-X-repo</id>
    <name>Maven Repo for X (releases)</name>
    <url>svn:https://X.googlecode.com/svn/maven-repo/releases</url>
    <uniqueVersion>false</uniqueVersion>
  </repository>
  <snapshotRepository>
    <id>maven-X-snapshot</id>
    <name>Maven Repo X (snapshots)</name>
    <url>svn:https://X.googlecode.com/svn/maven-repo/snapshots</url>
    <uniqueVersion>false</uniqueVersion>
 </snapshotRepository>
</distributionManagement>

Make sure to create the folders in svn !!! ... then add to the settings the credentials for the repos (both of them)

<server>
  <id>maven-X-repo-releases</id>
  <username>xxxx</username>
  <password>yyyy</password>
</server>

mvn deploy and you are done!

To use your jar is now easy! Put in the user pom this bit!

<repository>
  <id>X</id>
  <name>X</name>
  <url>http://X.googlecode.com/svn/maven-repo/releases</url>
<repository>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。