Skip to main content

Nexus Repository 2 Basics - Components, Repositories and Repository Formats

Nexus Repository 2

The Nexus platform with Nexus Repository Manager Pro, Nexus Repository Manager OSS and Nexus IQ Server is all about working with components and repositories.

So what are components? A component is a resource like a library or a framework that is used as part of your software application at run-time, integration or unit test execution time or required as part of your build process. It could be an entire application or a static resource like an image.

Typically these components are archives of a large variety of files including:

  • Java byte code in class files

  • C object files

  • text files e.g. properties files, XML files, JavaScript code, HTML, CSS

  • binary files such as images, PDF files, sound and music files

The archives are using numerous formats such as:

  • Java JAR, WAR, EAR formats

  • plain ZIP or .tar.gz files

  • Other package formats such as NuGet packages, Ruby gems, NPM packages

  • Executable formats such as .exe or .sh files, Android APK files and various installer formats

Components can be composed of multiple, nested components themselves. For example, consider a Java web application packaged as a WAR component. It contains a number of JAR components and a number of JavaScript libraries. All of these are standalone components in other contexts and happen to be included as part of the WAR component.

Components provide all the building blocks and features that allow a development team to create powerful applications by assembling them and adding their own business related components to create a full-fledged, powerful application.

In different tool-chains components are called artifacts, packages, bundles, archives, and other terms. The concept and idea remains the same and component is used as the independent, generic term.

Components in Repositories. A wide variety of components exists and more are continuously created by the open source community as well as proprietary vendors. There are libraries and frameworks written in various languages on different platforms that are used for application development every day. It has become a default pattern to build applications by combining the features of multiple components with your own custom components containing your application code to create an application for a specific domain.

In order to ease the consumption and usage of components, they are aggregated into collections of components. These are called repositories and are typically available on the internet as a service. On different platforms terms such as registry and others are used for the same concept.

Examples for such repositories are:

Components in these repositories are accessed by numerous tools including:

  • package managers like npm, nuget or gem,

  • build tools such as Maven, Gradle, rake and grunt

  • IDE’s such as Eclipse and IntelliJ

Repositories have Formats. The different repositories use different technologies to store and expose the components in them to client tools. This defines a repository format and as such is closely related to the tools interacting with the repository.

For example, the Maven repository format relies on a specific directory structure defined by the identifiers of the components and a number of XML formatted files for metadata. Component interaction is performed via plain HTTP commands and some additional custom interaction with the XML files.

Other repository formats use databases for storage and REST API interactions, or different directory structures with format specific files for the metadata.