You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/05/28 20:19:01 UTC

[maven-release] branch MRELEASE-1079 updated (1c6f2c3f -> 6a6ac839)

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

hboutemy pushed a change to branch MRELEASE-1079
in repository https://gitbox.apache.org/repos/asf/maven-release.git


 discard 1c6f2c3f [MRELEASE-1079] add edge case support: root pom inherits scm
 discard 1d5a846a [MRELEASE-1079] first try fixing, even if it breaks some UTs
 discard a58a0622 [MRELEASE-1079] new integration test
     add dbdae87e Use System.lineSeparator()
     add e4abd0ff Use class-based lookup
     new e8acf3a6 [MRELEASE-1079] new integration test
     new 6a6ac839 [MRELEASE-1079] restore test as it was before MRELEASE-998

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1c6f2c3f)
            \
             N -- N -- N   refs/heads/MRELEASE-1079 (6a6ac839)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../shared/release/config/ReleaseDescriptor.java   | 11 ++++++++-
 .../release/phase/AbstractRewritePomsPhase.java    | 26 ++++++++++------------
 .../release/phase/RewritePomVersionsPhase.java     |  5 ++---
 .../release/phase/RewritePomsForBranchPhase.java   |  9 ++++----
 .../phase/RewritePomsForDevelopmentPhase.java      |  7 +++---
 .../release/phase/RewritePomsForReleasePhase.java  |  9 ++++----
 .../src/main/mdo/release-descriptor.mdo            | 14 ++++++++++--
 .../release/phase/AbstractReleaseTestCase.java     |  9 ++++----
 .../phase/RewritePomsForReleasePhaseTest.java      |  4 ++++
 .../phase/ScmCommitPreparationPhaseTest.java       |  6 ++---
 10 files changed, 58 insertions(+), 42 deletions(-)


[maven-release] 02/02: [MRELEASE-1079] restore test as it was before MRELEASE-998

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6a6ac8399b010a6d82616201ed0fbb5be16ecbfd
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat May 28 22:13:53 2022 +0200

    [MRELEASE-1079] restore test as it was before MRELEASE-998
---
 .../maven/shared/release/config/ReleaseDescriptor.java     | 11 ++++++++++-
 .../shared/release/phase/RewritePomsForBranchPhase.java    |  2 +-
 .../shared/release/phase/RewritePomsForReleasePhase.java   |  2 +-
 maven-release-manager/src/main/mdo/release-descriptor.mdo  | 14 ++++++++++++--
 4 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
index 48ff5ac9..6ca7c0f0 100644
--- a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
+++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
@@ -485,11 +485,20 @@ public interface ReleaseDescriptor
     /**
      * <p>getOriginalScmInfo.</p>
      *
-     * @return the original {@code Scm} information.
      * @param projectKey the project key {@code String}
+     * @return the original {@code Scm} information.
      */
     Scm getOriginalScmInfo( String projectKey );
 
+    /**
+     * <p>hasOriginalScmInfo.</p>
+     *
+     * @param projectKey the project key {@code String}
+     * @return has original Scm info.
+     */
+    boolean hasOriginalScmInfo( String projectKey );
+
+
     // Modifiable
     /**
      * <p>addDependencyOriginalVersion.</p>
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 20893f72..b66f685a 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
@@ -96,7 +96,7 @@ public class RewritePomsForBranchPhase
                     // 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.getOriginalScmInfo( parentId ) == null )
+                    if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
                     {
                         // we need to add it, since it has changed from the inherited value
                         scmRoot = new Scm();
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 fa7df321..2217d919 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
@@ -95,7 +95,7 @@ public class RewritePomsForReleasePhase
                     // 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.getOriginalScmInfo( parentId ) == null )
+                    if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
                     {
                         // we need to add it, since it has changed from the inherited value
                         Scm scmTarget = new Scm();
diff --git a/maven-release-manager/src/main/mdo/release-descriptor.mdo b/maven-release-manager/src/main/mdo/release-descriptor.mdo
index 871637ac..32dfa060 100644
--- a/maven-release-manager/src/main/mdo/release-descriptor.mdo
+++ b/maven-release-manager/src/main/mdo/release-descriptor.mdo
@@ -719,13 +719,23 @@
     /**
      * Method getOriginalScmInfo.
      * 
-     * @return Map
+     * @return Scm
      */
     public org.apache.maven.model.Scm getOriginalScmInfo( String id )
     {
         return this.originalScmInfo.get( id );
-    } //-- java.util.Map<Object, String> getOriginalScmInfo()
+    } //-- Scm getOriginalScmInfo( String)
     
+    /**
+     * Method hasOriginalScmInfo.
+     * 
+     * @return map contains
+     */
+    public boolean hasOriginalScmInfo( String id )
+    {
+        return this.originalScmInfo.containsKey( id );
+    } //-- boolean hasOriginalScmInfo( String )
+
     /**
      * Method addOriginalScmInfo.
      * 


[maven-release] 01/02: [MRELEASE-1079] new integration test

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e8acf3a638bc31bfc9013cc64ff2e67fa5376578
Author: mac <de...@markusschaefer-online.de>
AuthorDate: Wed Mar 2 13:56:52 2022 +0100

    [MRELEASE-1079] new integration test
---
 .../MRELEASE-1053-bug/module-a/module-b/pom.xml    | 37 ++++++++++++++
 .../apache/maven/plugin/release/module/a/App.java  | 32 ++++++++++++
 .../maven/plugin/release/module/a/AppTest.java     | 57 ++++++++++++++++++++++
 .../prepare/MRELEASE-1053-bug/module-a/pom.xml     | 33 +++++++++++++
 .../it/projects/prepare/MRELEASE-1053-bug/pom.xml  | 51 +++++++++++++++++++
 .../prepare/MRELEASE-1053-bug/verify.groovy        | 26 ++++++++++
 6 files changed, 236 insertions(+)

diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/pom.xml
new file mode 100644
index 00000000..97776618
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.plugin.release</groupId>
+    <artifactId>module-a</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.maven.plugin.release</groupId>
+  <artifactId>module-b</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/main/java/org/apache/maven/plugin/release/module/a/App.java b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/main/java/org/apache/maven/plugin/release/module/a/App.java
new file mode 100644
index 00000000..05ca6eca
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/main/java/org/apache/maven/plugin/release/module/a/App.java
@@ -0,0 +1,32 @@
+package org.apache.maven.plugin.release.module.a;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java
new file mode 100644
index 00000000..ca41b5f5
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/module-b/src/test/java/org/apache/maven/plugin/release/module/a/AppTest.java
@@ -0,0 +1,57 @@
+package org.apache.maven.plugin.release.module.a;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/pom.xml
new file mode 100644
index 00000000..f5b00fca
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/module-a/pom.xml
@@ -0,0 +1,33 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.plugin.release</groupId>
+    <artifactId>mrelease-1053-bug</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.maven.plugin.release</groupId>
+  <artifactId>module-a</artifactId>
+  <packaging>pom</packaging>
+  <modules>
+    <module>module-b</module>
+  </modules>
+</project>
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/pom.xml
new file mode 100644
index 00000000..92f6be33
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugin.release</groupId>
+  <artifactId>mrelease-1053-bug</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <url>https://issues.apache.org/jira/browse/MRELEASE-1053</url>
+  <modules>
+    <module>module-a</module>
+  </modules>
+
+  <scm>
+    <connection>scm:git|sd_pa/tools/release-test</connection>
+  </scm>
+
+  <properties>
+    <maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
+    <maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-release-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/verify.groovy
new file mode 100644
index 00000000..262a71d0
--- /dev/null
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053-bug/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+// check module-a project
+project = new XmlSlurper().parse( new File( new File ( basedir, 'module-a' ), 'pom.xml.tag' ) )
+assert 0 == project.scm.size() // scm element must not exist in module
+
+// check module-b project
+project = new XmlSlurper().parse( new File( new File (new File ( basedir, 'module-a' ), 'module-b'), 'pom.xml.tag' ) )
+assert 0 == project.scm.size() // scm element must not exist in module
\ No newline at end of file