Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven deploy:deploy using -DaltDeploymentRepository

People also ask

Can we deploy using Maven?

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.

Where does mvn deploy deploy to?

The maven deploy plugin can be used to deploy either files or projects to the remote repository for sharing it with other developers and projects. There are various methods can be used to deploy your artifact to the remote repository by using a maven deploy plugin.

How do I run a Maven deploy command?

Checks out the code using the previously defined tag and run the Maven deploy goal, to deploy the war or built artifact to repository. Let's open the command console, go to the C:\ > MVN >bus-core-api directory and execute the following mvn command. Maven will start building the project.

What is the use of mvn deploy command in Maven?

The mvn deploy runs the deploy plugin which deploys an artifact to the remote repository. A project may include the main jar and associated sources and Javadoc jars. The sources jar contains the Java sources, and the Javadoc jar contains the generated Javadoc.


altDeploymentRepository String - Specifies an alternative repository to which the project artifacts should be deployed ( other than those specified in <distributionManagement> ). Format: id::layout::url

— (source)

So, in you case: releaseRepository::default::http://your.repo.url (see here for layout).


"layout" is a legacy switch provided for backwards compatibility with Maven 1, and at this point an anachronism. If you are using Maven 2 or Maven 3 (as I believe at least 99.99% of the world must be at this point) it is indeed "default", as described elsewhere here. By stating that the answer is unequivocally "default", the question of the utility of the switch is obviated; if it is always "default", which does it still exist?

If you are actually using Maven 1 still, it should be "legacy", but I hope no one is. All this is describe in the Maven specifications:

layout Either default for the Maven2 layout or legacy for the Maven1 layout. Maven3 also uses the default layout.

https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html