Pages

Saturday, August 20, 2016

Artifactory - Nexus


Before starting to understand what nexus is and how it can be used we need to understand what a software repository is. A Software repository is a storage location from which software packages may be retrieved and installed on the computer (according to WIKI).

So an artifactory repository is a binary repository manager. Much like source control that we use for our code (SVN, GIT) we use artifactory repository manager for storing and sharing our binary artifacts like jar and war. Artifactory is also a place where you can put a shared library so that it is easily accessible in other projects across the enterprise.

Many programming languages maintain their artifactory so that other users can download from that artifactory repository. An artifactory provide Operators on repositories like a package management system, tools intended to search for, install and otherwise manipulate software packages from the repositories

So why do we need a artifactory repository tool.

1. Re-building from source introduces points of failures. BY having the artifact in a binary repository manager we can down and use which will be a versioned copy of the tested artifact

2. Since the binaries are version it is easy to have multiple versions of libraries so that all projects do not have to be on the same version.

Repository types – There are different types of repositories available in nexus such as,

Virtual repositories - “virtual repositories” are proxies to all of the “well known” repositories on the internet. This give you access to most of the public shared libraries such as Apache Commons, Spring, Hibernate, etc..; through one conduit.

Proxy Repository - Is a repository with the type proxy, also known as a proxy repository, is a repository that is linked to a remote repository.Any request for a component is verified against the local content of the proxy repository. If no local component is found, the request is forwarded to the remote repository. The component is then retrieved and stored locally in the repository manager, which acts as a cache. Subsequent requests for the same component are then fulfilled from the local storage, therefore eliminating the network bandwidth and time overhead of retrieving the component from the remote repository again.

Hosted Repository - A repository with the type hosted, also known as a hosted repository, is a repository that stores components in the repository manager as the authoritative location for these components.

In this article we will see how we can configure nexus repository and use,

1.  Nexus comes with 2 flavors “Nexus Repository Manager Pro” and “Nexus Repository Manager OSS”.

Nexus Repository Manager OSS is a fully-featured repository manager which can be freely used, customized, and distributed under the Eclipse Public License.

Nexus Repository Manager Pro is a distribution with features that are relevant to large enterprises and organizations which require complex procurement and staging workflows in addition to more advanced LDAP integration, Atlassian Crowd support, and other development infrastructure. This is available for a 30 days trail.

2. Download the “Nexus Repository Manager OSS” from http://www.sonatype.com/download-oss-sonatype

3. Unzip or Tar based on the file you downloaded using
unzip nexus-2.13.0-01-bundle.zip OR tar xvzf nexus-2.13.0-01-bundle.tar.gz

4. Before starting nexus ,we need to make a few changes to the nexus.properties file in NEXUS_HOME/conf/nexus.properties

Change the nexus-work=<Location to store the nexus runtime Data>
Change the application-port to a port number where we can access the nexus Browser.

4. Once saved, start the nexus using NEXUS_HOME/bin/nexus start.

More to Come, Happy learning J

1 comment :

  1. I could not resist commenting. Exceptionally well written!

    ReplyDelete