Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a maven (distribution) repository on the command line

I think this should be possible, but I have not found anything related to it, as all I have found relates to dependency repositories.

What I would like to do is define the repository where maven (deploy, or release plugin for example) pushes the artifacts. How can I define it on the command line? I assume it is -Dsomething

UPDATE: When I read a jenkins error output carefully, it hints about using:
-DaltDeploymentRepository=id::layout::url

What Is the format for using this? What is the layout parameter?

like image 991
varesa Avatar asked Sep 15 '12 07:09

varesa


1 Answers

The simplest thing is to read the documentation about the maven-deploy-plugin which describes the format:

mvn -DaltDeploymentRepository=repositoryId::default::http://WhatEverURL

In the distributionManagement you usually give things like:

 <distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>MyCo Internal Repository</name>
      <url>Host to Company Repository</url>
    </repository>
  </distributionManagement>

If you like to use a different URL in this case you need to give:

mvn -DaltDeploymentRepository=internal.repo::default::http://WhatEverURL

The default in this case is the default for the maven repository layout.

like image 168
khmarbaise Avatar answered Sep 21 '22 19:09

khmarbaise