This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-release.git


The following commit(s) were added to refs/heads/master by this push:
     new f0313fc6 Check all project parents for SCM information.
f0313fc6 is described below

commit f0313fc6f142e1b6b547f54fe8ea0687981feb16
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Wed Nov 19 00:11:12 2025 +0100

    Check all project parents for SCM information.
    
    During the project transformation, we need to verify all parent projects.
    Otherwise, modules at deeper levels may have an SCM tag added unnecessarily.
    
    fix #1420
---
 .../release/phase/RewritePomsForBranchPhase.java   | 32 ++++++--------
 .../release/phase/RewritePomsForReleasePhase.java  | 32 ++++++--------
 .../maven/shared/release/util/ReleaseUtil.java     | 17 ++++++++
 .../branch/gh-1420/module1/module2/pom.xml         | 31 ++++++++++++++
 .../src/it/projects/branch/gh-1420/module1/pom.xml | 37 ++++++++++++++++
 .../src/it/projects/branch/gh-1420/pom.xml         | 50 ++++++++++++++++++++++
 .../src/it/projects/branch/gh-1420/verify.groovy   | 44 +++++++++++++++++++
 .../prepare/gh-1420/module1/module2/pom.xml        | 31 ++++++++++++++
 .../it/projects/prepare/gh-1420/module1/pom.xml    | 37 ++++++++++++++++
 .../src/it/projects/prepare/gh-1420/pom.xml        | 50 ++++++++++++++++++++++
 .../src/it/projects/prepare/gh-1420/verify.groovy  | 44 +++++++++++++++++++
 11 files changed, 369 insertions(+), 36 deletions(-)

diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
index 59052c70..867e40f1 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
@@ -28,7 +28,6 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Map;
 
-import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
 import org.apache.maven.project.MavenProject;
@@ -82,24 +81,21 @@ public class RewritePomsForBranchPhase extends 
AbstractRewritePomsPhase {
                     throw new ReleaseExecutionException(e.getMessage(), e);
                 }
             } else {
-                MavenProject parent = project.getParent();
-                if (parent != null) {
-                    // If the SCM element is not present, only add it if the 
parent was not mapped (ie, it's external to
-                    // the release process and so has not been modified, so 
the values will not be correct on the tag),
-                    String parentId = 
ArtifactUtils.versionlessKey(parent.getGroupId(), parent.getArtifactId());
-                    if (!releaseDescriptor.hasOriginalScmInfo(parentId)) {
-                        // we need to add it, since it has changed from the 
inherited value
-                        scmRoot = new Scm();
-                        // reset default value (HEAD)
-                        scmRoot.setTag(null);
-
-                        try {
-                            if (translateScm(project, releaseDescriptor, 
scmRoot, scmRepository, result)) {
-                                modelTarget.setScm(scmRoot);
-                            }
-                        } catch (IOException e) {
-                            throw new 
ReleaseExecutionException(e.getMessage(), e);
+                // If the SCM element is not present, only add it if the 
parent was not mapped (ie, it's external to
+                // the release process and so has not been modified,
+                // so the values otherwise won't be correct on the tag),
+                if (ReleaseUtil.hasNoOriginalScmInfoInParents(project, 
releaseDescriptor)) {
+                    // we need to add it, since it has changed from the 
inherited value
+                    scmRoot = new Scm();
+                    // reset default value (HEAD)
+                    scmRoot.setTag(null);
+
+                    try {
+                        if (translateScm(project, releaseDescriptor, scmRoot, 
scmRepository, result)) {
+                            modelTarget.setScm(scmRoot);
                         }
+                    } catch (IOException e) {
+                        throw new ReleaseExecutionException(e.getMessage(), e);
                     }
                 }
             }
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
index 67b9f18c..c559a41b 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
@@ -28,7 +28,6 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Map;
 
-import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
 import org.apache.maven.project.MavenProject;
@@ -81,24 +80,21 @@ public class RewritePomsForReleasePhase extends 
AbstractRewritePomsPhase {
                     throw new ReleaseExecutionException(e.getMessage(), e);
                 }
             } else {
-                MavenProject parent = project.getParent();
-                if (parent != null) {
-                    // If the SCM element is not present, only add it if the 
parent was not mapped (ie, it's external to
-                    // the release process and so has not been modified, so 
the values will not be correct on the tag),
-                    String parentId = 
ArtifactUtils.versionlessKey(parent.getGroupId(), parent.getArtifactId());
-                    if (!releaseDescriptor.hasOriginalScmInfo(parentId)) {
-                        // we need to add it, since it has changed from the 
inherited value
-                        Scm scmTarget = new Scm();
-                        // reset default value (HEAD)
-                        scmTarget.setTag(null);
-
-                        try {
-                            if (translateScm(project, releaseDescriptor, 
scmTarget, scmRepository, result)) {
-                                modelTarget.setScm(scmTarget);
-                            }
-                        } catch (IOException e) {
-                            throw new 
ReleaseExecutionException(e.getMessage(), e);
+                // If the SCM element is not present, only add it if the 
parent was not mapped (ie, it's external to
+                // the release process and so has not been modified,
+                // so the values otherwise won't be correct on the tag),
+                if (ReleaseUtil.hasNoOriginalScmInfoInParents(project, 
releaseDescriptor)) {
+                    // we need to add it, since it has changed from the 
inherited value
+                    Scm scmTarget = new Scm();
+                    // reset default value (HEAD)
+                    scmTarget.setTag(null);
+
+                    try {
+                        if (translateScm(project, releaseDescriptor, 
scmTarget, scmRepository, result)) {
+                            modelTarget.setScm(scmTarget);
                         }
+                    } catch (IOException e) {
+                        throw new ReleaseExecutionException(e.getMessage(), e);
                     }
                 }
             }
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
index 3fcd7f2a..a37a3bdf 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
@@ -26,6 +26,7 @@ import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.release.ReleaseExecutionException;
@@ -204,4 +205,20 @@ public class ReleaseUtil {
         }
         return value;
     }
+
+    /**
+     * Check if none of the parent projects have original SCM info in the 
release descriptor.
+     */
+    public static boolean hasNoOriginalScmInfoInParents(MavenProject project, 
ReleaseDescriptor releaseDescriptor) {
+        MavenProject parent = project.getParent();
+        while (parent != null) {
+            String parentId = 
ArtifactUtils.versionlessKey(parent.getGroupId(), parent.getArtifactId());
+            if (releaseDescriptor.hasOriginalScmInfo(parentId)) {
+                return false;
+            }
+            parent = parent.getParent();
+        }
+
+        return true;
+    }
 }
diff --git 
a/maven-release-plugin/src/it/projects/branch/gh-1420/module1/module2/pom.xml 
b/maven-release-plugin/src/it/projects/branch/gh-1420/module1/module2/pom.xml
new file mode 100644
index 00000000..0efb1598
--- /dev/null
+++ 
b/maven-release-plugin/src/it/projects/branch/gh-1420/module1/module2/pom.xml
@@ -0,0 +1,31 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.maven.plugins.release.its</groupId>
+    <artifactId>module1</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>module2</artifactId>
+  <packaging>pom</packaging>
+
+</project>
diff --git 
a/maven-release-plugin/src/it/projects/branch/gh-1420/module1/pom.xml 
b/maven-release-plugin/src/it/projects/branch/gh-1420/module1/pom.xml
new file mode 100644
index 00000000..8b0c7b1a
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/branch/gh-1420/module1/pom.xml
@@ -0,0 +1,37 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.maven.plugins.release.its</groupId>
+    <artifactId>gh-1420</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>module1</artifactId>
+
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>module2</module>
+  </modules>
+
+</project>
diff --git a/maven-release-plugin/src/it/projects/branch/gh-1420/pom.xml 
b/maven-release-plugin/src/it/projects/branch/gh-1420/pom.xml
new file mode 100644
index 00000000..897f0486
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/branch/gh-1420/pom.xml
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.codehaus.maven.plugins.release.its</groupId>
+  <artifactId>gh-1420</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://github.com/apache/maven-release/issues/1420</url>
+  <description>Check whether the child modules do not have an SCM 
tag</description>
+
+  <scm>
+    <connection>scm:git|sd_pa/tools/release-test</connection>
+    <tag>HEAD</tag>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <modules>
+    <module>module1</module>
+  </modules>
+</project>
diff --git a/maven-release-plugin/src/it/projects/branch/gh-1420/verify.groovy 
b/maven-release-plugin/src/it/projects/branch/gh-1420/verify.groovy
new file mode 100644
index 00000000..086f8a18
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/branch/gh-1420/verify.groovy
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import groovy.xml.XmlSlurper
+
+def pom = new XmlSlurper().parse( new File( basedir, 'pom.xml.branch' ) )
+assert pom.scm.tag.text() == 'gh-1420-1.0-SNAPSHOT'
+assert pom.version.text() == '1.0-SNAPSHOT'
+
+def pomNext = new XmlSlurper().parse( new File( basedir, 'pom.xml.next' ) )
+assert pomNext.scm.tag.text() == 'HEAD'
+assert pomNext.version.text() == '1.1-SNAPSHOT'
+
+def pom1 = new XmlSlurper().parse( new File( basedir, 'module1/pom.xml.branch' 
) )
+assert pom1.scm.size() == 0
+assert pom1.parent.version.text() == '1.0-SNAPSHOT'
+
+def pom1Next = new XmlSlurper().parse( new File( basedir, 
'module1/pom.xml.next' ) )
+assert pom1Next.scm.size() == 0
+assert pom1Next.parent.version.text() == '1.1-SNAPSHOT'
+
+def pom2 = new XmlSlurper().parse( new File( basedir, 
'module1/module2/pom.xml.branch' ) )
+assert pom2.scm.size() == 0
+assert pom2.parent.version.text() == '1.0-SNAPSHOT'
+
+def pom2Next = new XmlSlurper().parse( new File( basedir, 
'module1/module2/pom.xml.next' ) )
+assert pom2Next.scm.size() == 0
+assert pom2Next.parent.version.text() == '1.1-SNAPSHOT'
diff --git 
a/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/module2/pom.xml 
b/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/module2/pom.xml
new file mode 100644
index 00000000..0efb1598
--- /dev/null
+++ 
b/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/module2/pom.xml
@@ -0,0 +1,31 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.maven.plugins.release.its</groupId>
+    <artifactId>module1</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>module2</artifactId>
+  <packaging>pom</packaging>
+
+</project>
diff --git 
a/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/pom.xml 
b/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/pom.xml
new file mode 100644
index 00000000..8b0c7b1a
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/gh-1420/module1/pom.xml
@@ -0,0 +1,37 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.maven.plugins.release.its</groupId>
+    <artifactId>gh-1420</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>module1</artifactId>
+
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>module2</module>
+  </modules>
+
+</project>
diff --git a/maven-release-plugin/src/it/projects/prepare/gh-1420/pom.xml 
b/maven-release-plugin/src/it/projects/prepare/gh-1420/pom.xml
new file mode 100644
index 00000000..897f0486
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/gh-1420/pom.xml
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.codehaus.maven.plugins.release.its</groupId>
+  <artifactId>gh-1420</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://github.com/apache/maven-release/issues/1420</url>
+  <description>Check whether the child modules do not have an SCM 
tag</description>
+
+  <scm>
+    <connection>scm:git|sd_pa/tools/release-test</connection>
+    <tag>HEAD</tag>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <modules>
+    <module>module1</module>
+  </modules>
+</project>
diff --git a/maven-release-plugin/src/it/projects/prepare/gh-1420/verify.groovy 
b/maven-release-plugin/src/it/projects/prepare/gh-1420/verify.groovy
new file mode 100644
index 00000000..66ac2982
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/gh-1420/verify.groovy
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import groovy.xml.XmlSlurper
+
+def pom = new XmlSlurper().parse( new File( basedir, 'pom.xml.tag' ) )
+assert pom.scm.tag.text() == 'gh-1420-1.0'
+assert pom.version.text() == '1.0'
+
+def pomNext = new XmlSlurper().parse( new File( basedir, 'pom.xml.next' ) )
+assert pomNext.scm.tag.text() == 'HEAD'
+assert pomNext.version.text() == '1.1-SNAPSHOT'
+
+def pom1 = new XmlSlurper().parse( new File( basedir, 'module1/pom.xml.tag' ) )
+assert pom1.scm.size() == 0
+assert pom1.parent.version.text() == '1.0'
+
+def pom1Next = new XmlSlurper().parse( new File( basedir, 
'module1/pom.xml.next' ) )
+assert pom1Next.scm.size() == 0
+assert pom1Next.parent.version.text() == '1.1-SNAPSHOT'
+
+def pom2 = new XmlSlurper().parse( new File( basedir, 
'module1/module2/pom.xml.tag' ) )
+assert pom2.scm.size() == 0
+assert pom2.parent.version.text() == '1.0'
+
+def pom2Next = new XmlSlurper().parse( new File( basedir, 
'module1/module2/pom.xml.next' ) )
+assert pom2Next.scm.size() == 0
+assert pom2Next.parent.version.text() == '1.1-SNAPSHOT'

Reply via email to