LDSTech Maven repository structure
One of the major components of the LDSTech Platform is the platform's Maven repository. The Maven repository is responsible for hosting and distributing the libraries needed by an LDSTech Platform project. These libraries may be third-party libraries such as junit or first-party libraries. There are several Maven repositories in the wider Java development community, each providing its own libraries. ICS uses a Maven repository proxy to:
- Consolidate multiple third-party repositories and local release repositories into a single repository
- To govern what libraries are used
- To govern what internal first-party libraries are made available to the public
Community vs. Internal Repositories
ICS currently maintains 2 maven repositories. One located in the open and one behind our corporate firewall. The main reason for 2 repositories is that there are some artifacts that we cannot place in a public repository for reasons such as commercial license restrictions or sensitivity reasons.
Whenever we get a request to add a new artifact to a repository we will approve anything that can be used in the community in the community and only store it in the internal repository if we cannot place it in the community. That said we proxy our community repository in our internal repository. So if you are using the internal repositories you will automatically get any artifacts approved for use in the community repository. A project not intended to be developed in the community should always use the internal(icslib) repository and projects targeting community development should use the community repositories.
Although there are many repositories in each nexus instance, there are only 3 "group" repositories projects should use. No other repositories should be referenced in your project pom:
The Approved repository group is used for artifacts that are considered strategic. Project teams can use dependencies in this repository without restriction and can get support for many of these artifacts from the Java Stack team. This repository should be in every LDSTech Platform project's parent pom. The repository entry should look like the following:
<repository> <id>lds-main</id> <name>Main Approved LDS Repo</name> <url>http://code.lds.org/nexus/content/groups/main-repo</url> </repository>
<repository> <id>lds-internal-main</id> <name>LDS Internal Main Repo</name> <url>http://icslib/nexus/content/groups/main-repo</url> </repository>
The Contained repository group is used for dependencies that are not "strategic." Before using a dependency in the contained repository a request for approval should be made on the forum or for internal user create an issue in the SDS Jira Project. This is mostly a formality so that the Stack team can monitor what libraries are being used and to ensure those libraries are using approved licenses. If you are approved to use a given contained library then you must add the contained repository to your project. The repository entry should look like the following:
<repository> <id>lds-contained</id> <name>Contained LDS Repo</name> <url>http://code.lds.org/nexus/content/groups/contained-repo</url> </repository>
<repository> <id>lds-internal-contained</id> <name>Contained LDS Repo</name> <url>http://icslib/nexus/content/groups/contained-repo</url> </repository>
If your project needs a library that is not in either the Approved or Contained repositories a request to add that library can be submitted to the forum, or if you are an ICS employee to the SDS jira project.
The Plugin repository is a repository for loading Maven plugins and their dependencies. Since build-time dependencies are governed much more loosely than runtime libraries this repository proxies directly through to third-party repositories with little or no governance. This repository is already in the Stack Master parent pom so it doesn't need to be put in the project pom if your pom extends stack-master. However, if your project does not extend stack-master the repository entry would look like the following:
<pluginRepository> <id>lds-plugin</id> <name>LDS Plugin Repo</name> <url>http://code.lds.org/nexus/content/groups/plugin-repo</url> </pluginRepository>
<pluginRepository> <id>lds-internal-plugin</id> <name>LDS Internal Plugin Repo</name> <url>http://icslib/nexus/content/groups/plugin-repo</url> </pluginRepository>