Publishing Maven Artifacts for your Hippo Forge Project - BloomReach Experience - Open Source CMS

Publishing Maven Artifacts for your Hippo Forge Project

Do you have a project on Hippo Forge? Then you might want to deploy artifacts in a Maven repository, so your projects can be added as a dependency to other Maven projects. Hippo Forge has no central Maven repository, but you can use your project's SVN repository to publish the artifacts. To do this, you can use wagon-svn, a Maven Wagon provider for Subversion.

The first thing you need to do is create a space in your SVN repository to deploy the artifacts in. If your project's SVN repository is at

https://forge.onehippo.org/svn/myproject/

create a folder maven2 in the root of the repository, i.e.

https://forge.onehippo.org/svn/myproject/maven2/

In your project's POM, add the wagon-svn extension to the build section:

<build>
  ...
  <extensions>
    <extension>
      <groupId>org.jvnet.wagon-svn</groupId>
      <artifactId>wagon-svn</artifactId>
      <version>1.9</version>
    </extension>
  </extensions>
</build>

Then add a distributionManagement section to your project's POM, and specify the SVN location you created as the Maven repository to deploy artifacts to. For the id you can use any string you like.

<distributionManagement>
  <repository>
    <uniqueVersion>false</uniqueVersion>
    <id>myproject-maven-repo</id>
    <url>svn:https://forge.onehippo.org/svn/myproject/maven2/</url>
  </repository>
</distributionManagement>

Finally, add credentials for the Maven/SVN repository to your Maven settings.xml, located in the .m2 directory in your home directory (e.g. /home/username/.m2/settings.xml on Unix). Right under the settings element, add a servers element:

NOTE:

There is also a possibility to encrypt the passwords:

http://maven.apache.org/guides/mini/guide-encryption.html

<servers>
  <server>
    <id>docselector-maven-repo</id>
    <username>myname</username>
    <password>secret</password>
  </server>
</servers>

You should now be able to deploy artifacts to the SVN repository using the following command:

mvn deploy

Don't forget to add the location of the Maven repository to your project documentation! People need to add that repository location to their project POM or settings.xml in order to download dependencies from it.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?