Repository Management with Nexus

22.1. Prerequisites And Preparation

The following guide for evaluating Sonatype Nexus is based on an assumption of installing Nexus itself as well as the various technologies used in the specific evaluation example all on one computer. A more extended evaluation of Nexus in a team environment should follow the instructions for a full installation as documented in the book Repository Management with Nexus. Consult the book for further in-depth documentation about all features of Nexus.

Besides the installation of Nexus itself, various evaluations will need different prerequisites installed on the machine you use for your evaluation. The installation instructions of these technologies follow below. Only follow the instructions referenced from the examples you are interested in. For example you will only need to install Visual Studio and NuGet if you want to evaluate the .Net Integration of Nexus.

22.1.1. A Note about the Operating System

Some of the tasks described are referencing command line calls. Where that is the case, this guide will use Unix typical commands and syntax as used on a bash shell. This is the most common environment on Linux and Mac OSX computers. On Windows machines a bash shell can be installed as well, using e.g., the cygwin system. However the typical usage would be to use the Windows command prompt with slightly different calls. Table 22.1, “Commandline Invocation Examples” displays a number of examples for typical tasks carried out in the evaluations with their bash as well as Windows shell commands.

Table 22.1. Commandline Invocation Examples

Task Bash Shell Window Shell

Delete a file

rm filename

del filename

Delete a directory

rm -rf directoryname

rmdir directoryname

Delete a directory in users home directory

rm -rf ~/.m2/repository

rmdir /S %HOMEPATH%\.m2\repository

Change to the users home directory

cd ~

cd %HOMEPATH%

Script invocation

./build

build.bat

Gradle Wrapper script invocation

./gradlew

gradlew.bat


22.1.2. Java Runtime

Nexus itself as well as some of the technologies used in the evaluation require a Java runtime or development kit, which is available for most operating systems. We recommend to install the latest Oracle Java 7 JDK available from the download web page and following the installation instructions on the same site.

After a successful installation, you can verify it by running the command java -version, which should result in an output similar to

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
[Warning]

Nexus requires Java 7.

22.1.3. Apache Maven

Apache Maven can be retrieved from the download page and installed following the instructions available there. We recommend the usage of the latest available Maven 3 version.

After a successful installation you can verify it with running the command mvn --version, which should result in an output similar to

Apache Maven 3.2.1 (ea8b..; 2014-02-14T09:37:52-08:00)
Maven home: /opt/tools/apache-maven-3.2.1
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"

22.1.4. Gradle

The examples in this guide use the so-called Gradle wrapper script. It allows you to get gradle installed automatically by the wrapper and invoke all gradle commands via it. To use it you simple invoke all gradle commands with ./gradlew on Unix based systems and gradlew.bat on Windows instead of gradle.

Alternatively Gradle can be retrieved from the download page and installed following the instructions available in the User Guide. We recommend the usage of the latest available Gradle version.

After a successful installation you can verify it with running the command gradle -v, which should result in an output similar to

Gradle 1.11

Build time:   2014-02-11 11:34:39 UTC
Build number: none
Revision:     a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_51 (Oracle Corporation 24.51-b03)
OS:           Mac OS X 10.8.5 x86_64

22.1.5. Apache Ant and Apache Ivy

Apache Ant can be retrieved from the download page and installed following the instructions available in the manual. We recommend the usage of the latest available Ant version.

After a successful completion you can verify your Ant installation by running the command ant -version, which should result in an output similar to

Apache Ant(TM) version 1.9.2 compiled on July 8 2013

The example projects used in this guide, contain ant targets in their build files that will automatically install Apache Ivy as part of the build. Alternatively you can retrieve Apache Ivy from the download page and install it following the instructions.

22.1.6. Microsoft Visual Studio and NuGet

Microsoft Visual Studio and NuGet are needed to evaluate the .Net support of Nexus Professional. There are a number of different Visual Studio distributions. Some of these distributions, may have NuGet already installed, while others do not. Even if your Visual Studio installation is bundled with NuGet, you will want to make sure that you have upgraded to the latest version of the tool.

NuGet is a fast-paced project, and you’ll find that new packages available on NuGet Gallery may not be compatible with older versions of the NuGet package manager.

For detailed instructions on installing NuGet in Visual Studio, please go to the NuGet project’s documentation site and refer to the Installing NuGet instructions.