We have a internal artifactory repository. At the moment all snapshots will be deployed there. We also want to have a different server with a web interface, and want to copy the to it the created artifacts.
For our builds we use Hudson, but the post-build action "Deploy artifacts to Maven repository" together with scp doesn't work. So there is the question of doing it in some other elegant way. Why isn't maven able to have several distribution repositories? Any ideas?
The nicest thing would be if artifactory would support an (automatic!) incremental export to a standard maven repository after each new deployment.
So, the answer is yes, mvn deploy will execute install and build the project artifacts.
The deploy plugin is primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects. This is usually done in an integration or release environment.
I don't think maven supports deploying to multiple repositories for a single profile, but perhaps profiles could change the id and urls of the repository.
<distributionManagement>
<repository>
<id>${repo-id}</id>
<name>${repo-name}</name>
<url>${repo-url}</url>
</repository>
</distributionManagement>
Maven Deployment
Then use profiles to pick which repo to deploy to:
<profiles>
<profile>
<id>repo1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<repo-id>repo1</repo-id>
<repo-name>Repo1 Name </repo-name>
<repo-url>http://url.com/maven2</repo-url>
</properties>
</profile>
<profile>
<id>repo2</id>
<properties>
<repo-id>repo2</repo-id>
<repo-name>Repo2 Name </repo-name>
<repo-url>http://url2.com/maven2</repo-url>
</properties>
</profile>
</profiles>
Maven profiles
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With