Maven command to localize a remote dependency

I have a base pom that locates the repository for the connection that we use behind our firewall, and all our projects inherit from that base pom. However, the database exists in one of the repositories defined in the database, so you can see the problem with the circular link. I need to install maven: install-file, for example, a command with which I can run new team members to pull out and install the base project locally, without having to check the project from the control source and mvn installit.

+5
source share
1 answer

I need to install maven: install-file like command, with which I can run new team members to pull out and install the base project locally, without having to check the project out of source control and install its mvn.

The Dependency Maven plugin and it dependency:getcan help here, you can do something like this:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
    -Dartifact=groupId:artifactId:version[:packaging] \
    -DrepoUrl=http://repository.mycompany.com/ 

But let me return to the following:

However, the database exists in one of the repositories defined in the database (...)

If this is really not what you want (adding a repository for a thing not found in the center), this is usually not how people announce the Nexus repository in a corporate environment.

, Nexus . - , 1, 5, 10 . , maven , , , ? Nexus ( 4.2. Maven Nexus) settings.xml.

, ~/.m2/settings.xml, Maven conf/settings.xml.

+7

All Articles