Nexus

Centralized repository management is one of the principles highly recommended as part of 12-Factor app principles and CI/CD practices. Software applications are layered and dependent on numerous components put together at various layers. Each component again can be of a certain version. Software generally behaves with high quality when we have a clear dependency graph of all components with their versions. Hence keeping track of component versions helps address security, license and overall quality of the software. Also being able to share intermediary versions of applications with all dependencies is a key collaboration principle.

Depending on the stack , there are package managers like npm, bundler, nuget etc. With micro-services, polyglot stacks are a reality these days. Repository managers generally help by acting as intermediary cache/proxy to the package registries (npmjs, rubygems, nuget.org etc.). They also can act as application artifact storage space.

Reasons to use:

  • Speed up your builds (instead of going to public internet all the time)
  • Save Bandwidth
  • Ease the burden on central et al.
  • Gain Predictability and Scalability
  • Control and Audit Dependencies and Releases
  • Deploy Third-Party Artifacts
  • Collaborate with internal repositories
  • Distribute with Public repositories

You can read it from their website.

Each row in the top panel is a repository that can hold packages. I found the following types of repositories (as defined by nexus) to be mostly used: proxy, hosted and group (there are other types mentioned in the nexus documentation)

Dependency Management

Nexus repositories serve packages to the application build. In that scenario, the proxy repository acts as proxy between the application and public registries. Some of the public registries that align with various package managers are:

  • Maven Central
  • Ruby Gems
  • Nuget Central
  • npmjs
  • ...so on

Application Release Management

After application packages are built, nexus can provide a home for application release or snapshot packages. The repositories "Snapshots" and "Releases" are present out of the box when Nexus is installed. Both Snapshot and Release repositories take any archives (as opposed to repositories targeted for specific types like nuget, rubygems etc.)

In this tutorial, we will be using Nexus for application release management

Note: Android mobile projects generally resolve their dependencies through SDK and that in turn resolves jcenter.

Docker

With lightweight containers, docker helps you create sandbox environments, that replicate production environment. Assuming that you have a basic understanding of docker, spinning up a sandbox for Nexus is as below.

Video

Follow along the video to start a Nexus container.

results matching ""

    No results matching ""