0

I have a project that has the following structure

moduleA
  pom.xml
moduleB
  pom.xml

I don't have any base/root level pom.xml. I am trying to do a mvn release from inside the module. The release plugin prepares the pom.xml with the correct tags but then instead of deploying the release version, deploys the snapshot again. I have even referred this post and also this post and tried to implement the same solution but to no avail. Does mvn release not work on sub-module poms? I have shared my mvn build command and the mvn log below for better understanding. Has anyone faced this?

I see the following tag created on my local as well as my remote ncprocessorcommon-1.0.0

mvn command mvn -B -f ./pom.xml -DdevelopmentVersion=1.0.1-SNAPSHOT -DreleaseVersion=1.0.0 -Dresume=false release:clean release:prepare release:perform

mvn relevant log

[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git add -- pom.xml
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git status --porcelain
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Tagging release with the label ncprocessorcommon-1.0.0...
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git tag -F /var/folders/5_/c7lxvzrn5fd4dm80mcvnxqyc0000gq/T/maven-scm-979680333.commit ncprocessorcommon-1.0.0
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git push ssh://git@github.paypal.com/Notifications-R/ncprocessor.git ncprocessorcommon-1.0.0
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git ls-files
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Transforming 'ncprocessorcommon'...
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git add -- pom.xml
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon && git status --porcelain
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon
[INFO] Release preparation complete.
[INFO] 
[INFO] --- maven-release-plugin:2.4.2:perform (default-cli) @ ncprocessorcommon ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target && git clone --branch ncprocessorcommon-1.0.0 ssh://git@github.paypal.com/Notifications-R/ncprocessor.git /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target
[INFO] Executing: /bin/sh -c cd /var/folders/5_/c7lxvzrn5fd4dm80mcvnxqyc0000gq/T/ && git ls-remote ssh://git@github.paypal.com/Notifications-R/ncprocessor.git
[INFO] Working directory: /var/folders/5_/c7lxvzrn5fd4dm80mcvnxqyc0000gq/T
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout && git fetch ssh://git@github.paypal.com/Notifications-R/ncprocessor.git
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout && git checkout ncprocessorcommon-1.0.0
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout
[INFO] Executing: /bin/sh -c cd /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout && git ls-files
[INFO] Working directory: /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout
[INFO] Invoking perform goals in directory /Users/arsengupta/IdeaProjects/ncprocessor/ncprocessorcommon/target/checkout/ncprocessorcommon
[INFO] Executing goals 'deploy'...
[INFO] [INFO] Scanning for projects...
[INFO] [WARNING] 
[INFO] [WARNING] Some problems were encountered while building the effective model for com.paypal.notification.common:ncprocessorcommon:jar:1.0.0-SNAPSHOT
[INFO] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 125, column 21
[INFO] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 137, column 21
[INFO] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ org.apache.maven:maven-model-builder:3.8.4:super-pom, jar:file:/usr/local/apache-maven-3.8.4/lib/maven-model-builder-3.8.4.jar!/org/apache/maven/model/pom-4.0.0.xml, line 137, column 19
[INFO] [WARNING] 
[INFO] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[INFO] [WARNING] 
[INFO] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] [WARNING] 
[INFO] [INFO] 
[INFO] [INFO] ----------< com.paypal.notification.common:ncprocessorcommon >----------
[INFO] [INFO] Building ncprocessorcommon 1.0.0-SNAPSHOT
[INFO] [INFO] --------------------------------[ jar ]---------------------------------
[INFO] [INFO] 

pom relevant sections

<scm>
   <developerConnection>scm:git:ssh://..../.../ncprocessor.git</developerConnection>
   <connection>scm:git:ssh://..../.../ncprocessor.git</connection>
   <url>https://..../.../ncprocessor.git</url>
   <tag>HEAD</tag>
</scm>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <version>2.4.2</version>
    <executions>
      <execution>
        <id>default</id>
        <goals>
          <goal>perform</goal>
        </goals>
        <configuration>
          <pomFileName>ncprocessorcommon/pom.xml</pomFileName>
        </configuration>
      </execution>
    </executions>
    <dependencies>
      <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-gitexe</artifactId>
       <version>1.8.1</version>
      </dependency>
     </dependencies>
</plugin>
torek
  • 448,244
  • 59
  • 642
  • 775
Arnav Sengupta
  • 423
  • 1
  • 7
  • 19
  • First why are you binding the release plugin to the life cycle? Second why using such an old version? And finally why adding an explicit dependency to an scm provider? How does your full pom file look like? And where in the directory tree do you start the process? – khmarbaise Apr 11 '22 at 07:05
  • @khmarbaise The explicit dependency to an SCM provider is added as an attempt to resolve this issue, I have linked the two proposed posts in my write up. Even without that dependency I face the same issue. I have updated my post with the relevant pom sections instead of adding the full pom. And I start the process in under the moduleA directory. Should I just use the latest release plugin? (The older plugin is the default in my org) And I didn't understand what you meant by binding the release plugin to the life cycle? Can you please elaborate? – Arnav Sengupta Apr 11 '22 at 07:15
  • @khmarbaise Upgrading to version 3.0.0-M1 fixed it. Thanks! – Arnav Sengupta Apr 11 '22 at 14:54

1 Answers1

0

Upgrading the maven release plugin to <version>3.0.0-M1</version> solved the issue for me.

Arnav Sengupta
  • 423
  • 1
  • 7
  • 19