Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable building package in maven release plugin

I am both new to maven and the maven release plugin but what I am trying to achieve here is simple. I am able to use the maven release plugin using the command mvn release:prepare just fine however I don't want it to execute running the the entire build before bumping up the pom. I just want it to bump up the pom when I use it. How do I disable it from executing that goal?

like image 534
user3626708 Avatar asked Dec 05 '25 07:12

user3626708


2 Answers

The maven release plugin executes the goals specified in preparationGoals property, which are, by default, "clean verify".

Override the value of this property either through the plugin configuration:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <version>3.0.0-M1</version>
      <configuration>
        <preparationGoals></preparationGoals>
        <!-- your other configuration -->
      </configuration>
    </plugin>

or on the command line:

mvn release:prepare -DpreparationGoals= ...

to specify whatever other goals you might want to execute instead. For example, setting it to initialize or to an empty string all together.

like image 114
Pawel Veselov Avatar answered Dec 07 '25 21:12

Pawel Veselov


You meant, you want to skip the "build" of the project when run the prepare goal?

If so, as far i know, it cannot be done, as the prepare is a mandatory step for a prepare. In fact the prepare check

  1. If all the dependencies are resolved with the given versions.
  2. If the resolved dependencies permit the build of the project.

From the official documentation (Link): Preparing a release goes through the following release phases:

  1. Check that there are no uncommitted changes in the sources
  2. Check that there are no SNAPSHOT dependencies
  3. Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  4. Transform the SCM information in the POM to include the final destination of the tag
  5. Run the project tests against the modified POMs to confirm everything is in working order
  6. Commit the modified POMs
  7. Tag the code in the SCM with a version name (this will be prompted for)
  8. Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  9. Commit the modified POMs
like image 34
ivoruJavaBoy Avatar answered Dec 07 '25 22:12

ivoruJavaBoy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!