Buildix + Maven2 Part 3
When using maven2, instead of downloading all the jars from the internet, you should setup your local internal repository and use it as a maven proxy. It's pretty simple, if you try a retrieve a jar file that is not exists in the internal repository, the internal repository will download it from the internet and then cache it, so that next time when you need it again, you can get it off the cache. This will save your time and bandwidth. The other purpose of using an internal repository is you can publish your jar/war/ear files, so that it can be used by other team members.
There are many open source maven2 repositories out there, e.g. Archive, Proximity and Artifactory. I've chosen Artifactory because it's the most active project. It has good documentation and it's is very simple to install and use.
Artifactory can be run as a standalone java application or you can deploy it as a war file. Since Buildix comes with tomcat5, so I decided to put it there.
Download Artifactory and then extract it to /usr/share/artifactory-1.X.X as root
Add the -Dartifactory.home argument in /usr/share/tomcat5/bin/catalina.sh
JAVA_OPTS=" -Xms128m -Xmx384m -Dartifactory.home=/usr/share/artifactory-1.2.2 "
export JAVA_OPTS
Copy the configuration file to /usr/share/artifactory-1.X.X/etc/artifactory.config.xml
Create 3 directories logs, backup and data under /usr/share/artifactory-1.X.X and then chown these directories to cruise
To deploy Artifactory into tomcat, you need to create a simlink in /usr/share/tomcat5/webapps
Finally, login as cruise and go to added a new profile in the settings.xml (if not exists) under the directory ~/.m2
<profile>
<id>profile-id-internal-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>http://buildix.hostname/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://buildix.hostname/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://buildix.hostname/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://buildix.hostname/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
That's it!! You may now go to http://buildix.hostname/artifactory and verfiy it by login as admin/password.
