deploy artifacts to multiple maven repositories

saharey
saharey used Ask the Experts™
on
Hi All,
Is there any way that I can deploy maven artifacts to multiple central maven repositories, means say if I have 2 maven repositories “A”  and “B” so when I do ‘mvn deploy’ will it be possible to deploy artifacts to these two repositories simultaneously.

Any help in this regard will be highly appertiated.

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Configure deploy plugin multiple times:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
  <phase>deploy</phase>
    <goals>
      <goal>deploy-file</goal>
    </goals>
    <configuration>
      <packaging>jar</packaging>
      <generatePom>true</generatePom>
      <url>${project.distributionManagement.repository.url}</url>
      <artifactId>${project.artifactId}</artifactId>
      <groupId>${project.groupId}</groupId>
      <version>${project.version}</version>
      <file>${project.build.directory}/${project.build.finalName}.jar</file>
    </configuration>
  </execution>
</executions>
</plugin>

Open in new window

Author

Commented:
I am looking into this solution, but did not find feasible as I did not have to deploy the artifacts only to 2 repo but to 3, and also this operation will increase my build time drastically.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial