0

I have a maven project, where the POM file looks like below.

<project>
    <groupId>foo</groupId>
    <artifactId>bar</artifactId>
    <version>2.3-SNAPSHOT</version>
    
    <properties>
        <ABC.MNO.version>1.0-SNAPSHOT</ABC.MNO.version>
    </properties>

    <dependencies>
       <dependency>
          <groupID>ABC</groupId>
          <artifactId>MNO</artifactId>
          <version>${ABC.MNO.version}</version>
       </dependency>
    </dependencies>
</project>

I need to do non-interactive release on this maven project. My requirements are that for the release, the versions of foo.bar and ABC.MNO would be 2.3 and 1.0 respectively. And for the next development iteration, the versions of foo.bar and ABC.MNO would be 2.4-SNAPSHOT and 1.1-SNAPSHOT respectively. How can I mention these in the release.properties file rather than passing command line arguments ?

I know that we can mention foo.bar versions as below in release.properteis

project.rel.foo\:bar=2.3
project.dev.foo\:bar=2.4-SNAPSHOT

But how do we mention about the items in the properties (ABC.MNO) in the release.properties ? If I do it as below,

dependency.ABC\:MNO.release = 1.0
dependency.ABC\:MNO.development = 1.1-SNAPSHOT

then the release:prepare is throwing error as below

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M4:prepare (default-cli) on project P1: The artifact (ABC:MNO) requires a different version (1.0) than what is found (1.0-SNAPSHOT) for the expression (ABC.MNO.version) in the project P1

Can anyone explain me on what needs to be done to do non-interactive release here ?

Harsha Chittepu
  • 115
  • 1
  • 8

0 Answers0