Nexus (update, configuration)

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 
/etc/init.d/nexus stop
  • 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.
  1. Logged onto the tool
  2. Go to Repositories, click on the "add' button and select "Proxy repository"
  3. 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.
  4. Click on the save button
  5. Then, select "Public repositories" and go to the "Configuration tab"
  6. 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.
 
  1. Logged on to http://gazelle.ihe.net/nexus/index.html#view-repositories;thirdparty~browseindex
  2. Create a pom like this : 
    <dependency>
      <groupId>com.pixelmed</groupId>
      <artifactId>dicom</artifactId>
      <version>20140326</version>
    </dependency>
  3. Click on "Artifact upload"
  4. Select GAV definition : From POM
  5. Select your new pom to upload it
  6. Add artificats : sourceFiles.jar and executable.jar
  7. To finish click on upload artifacts
You can now get your dependency