Tomas Marik
Tomas Marik

Reputation: 4093

Maven Release: How to skip deploy step?

To release my app I am using maven-release-plugin.

One step in this process is deploying the release into the repository. I would like to avoid this step, but when I remove distributionManagement from my pom file I am getting the error:

Deployment failed: repository element was not specified in the POM inside distributionManagement element 

How to configure maven-release-plugin to skip deploying?

Thanks for any advice!

Upvotes: 4

Views: 4503

Answers (2)

khmarbaise
khmarbaise

Reputation: 97359

This is nothing unusual or funny to release several times a day..space issue might be questionable but this is a separate discussion.

You can configure the maven release plugin what kind of goals will be done during the release. This can be achieved by configuring the plugin in a pluginManagement at best. And also you should define all the versions of all plugins you are using (most of the time it is most convenient to create a parent pom for your environment).

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <configuration>
    <arguments>${arguments}</arguments>
    <goals>The Goal You would like to execute</goals>
    <autoVersionSubmodules>true</autoVersionSubmodules>
  </configuration>
</plugin>

So you could define to only make install instead of deploy like this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <configuration>
    <arguments>${arguments}</arguments>
    <goals>install</goals>
    <autoVersionSubmodules>true</autoVersionSubmodules>
  </configuration>
</plugin>

Upvotes: 4

VonC
VonC

Reputation: 1323443

As mentioned here, you can use:

mvn release:perform -Darguments="-Dmaven.deploy.skip=true"

(which is also available on other plugins, like github-release-plugin)

As seen in glib-briia/cucumber-jvm-scala pom.xml, you can also define a profile in your pom.xml in order to activate the skip when you want.

Upvotes: 2

Related Questions