Nexus is used to manage the Maven artifacts both the third-part ones required by our applications and the ones developed by the team. Our repository is available at http://gazelle.ihe.net/nexus and is currently installed on Sumo and owned by user nexus.
Updating Nexus
The start up script is located at /etc/init.d/nexus and do not need to be updated.
To update the tool, process as follow:
- Download the lastest version of the tool (tgz archive named Nexus OSS) and uncompress it in /opt/nexus
- In the new directory, change the configuration. Depending on the various releases, some properties have changed, but by now, we only need to change the port :
- nexus-2.3.1-01/conf/nexus.properties : application-port=9080
- Then, stop nexus as root
- and execute the following commands:
su nexus
cd /opt/nexus
rm nexus-oss-webapp
ln -s nexus-2.3.1-01 nexus-oss-webapp
exit
/etc/init.d/nexus start
The previous configuration files are available in nexus-oss-webapp-conf
Creating a new proxy in Nexus
You may need to use artifacts from third-party repositories. In some cases, those artifacts are not referenced within the common Maven repository and thus you will need create a new "proxy" repository to have Nexus to get them for you.
- Logged onto the tool
- Go to Repositories, click on the "add' button and select "Proxy repository"
- Fill out the form; the provider of the artifact must provide the "Remote storage location" to specify. Basically, it's the root of the maven repository.
- Click on the save button
- Then, select "Public repositories" and go to the "Configuration tab"
- The repository you have created shall be displayed in the "Available repositories" column, move it to the "Ordered Group Repositories" column
You can now build your project, the dependency will be downloaded and cached by Nexus.
Add a jar in nexus
You need to get your executable jar file and source files in jar.
- Logged on to http://gazelle.ihe.net/nexus/index.html#view-repositories;thirdparty~browseindex
- Create a pom like this :
<dependency>
<groupId>com.pixelmed</groupId>
<artifactId>dicom</artifactId>
<version>20140326</version>
</dependency>
- Click on "Artifact upload"
- Select GAV definition : From POM
- Select your new pom to upload it
- Add artificats : sourceFiles.jar and executable.jar
- To finish click on upload artifacts
You can now get your dependency