maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject [maven-release] 01/01: Update parent to 32 Switch to asfMavenTlpPlgnBuild Support https.protocols
Date Thu, 23 Aug 2018 10:35:11 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit f4345e66c91853e19a6befccb44866f8195dc831
Author: rfscholte <rfscholte@apache.org>
AuthorDate: Thu Aug 23 12:35:01 2018 +0200

    Update parent to 32
    Switch to asfMavenTlpPlgnBuild
    Support https.protocols
---
 Jenkinsfile                                        |  2 +-
 .../shared/release/config/ReleaseDescriptor.java   |  6 ++++
 .../shared/release/versions/AetherVersion.java     |  2 +-
 .../release/versions/MavenArtifactVersion.java     |  2 +-
 .../config/PropertiesReleaseDescriptorStore.java   |  6 ++++
 .../release/config/ReleaseDescriptorBuilder.java   |  6 ++++
 .../maven/shared/release/config/ReleaseUtils.java  |  5 ++++
 .../release/phase/AbstractRunGoalsPhase.java       | 18 +++++++++++
 .../release/phase/RunCompleteGoalsPhase.java       |  2 +-
 .../shared/release/phase/RunPerformGoalsPhase.java |  2 +-
 .../shared/release/phase/RunPrepareGoalsPhase.java |  2 +-
 .../src/main/mdo/release-descriptor.mdo            | 22 +++++++-------
 maven-release-plugin/pom.xml                       | 20 +++++++++++++
 .../it/projects/perform/MRELEASE-459/verify.groovy |  2 +-
 .../projects/prepare/MRELEASE-571_M3/verify.groovy |  4 +--
 .../src/it/projects/prepare/MRELEASE-667/pom.xml   |  2 +-
 .../maven/plugins/release/AbstractReleaseMojo.java | 35 ++++++----------------
 pom.xml                                            |  4 +--
 18 files changed, 92 insertions(+), 50 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 09ac70f..e9f05f7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-asfMavenTlpStdBuild()
+asfMavenTlpPlgnBuild()
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 042a347..12d02e6 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
@@ -208,6 +208,12 @@ public interface ReleaseDescriptor
     boolean isScmUseEditMode();
 
     /**
+     * 
+     * @return list of profiles to activate
+     */
+    List<String> getActivateProfiles();
+
+    /**
      * Get the last completed phase.
      * 
      * @return String
diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/AetherVersion.java
b/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/AetherVersion.java
index c03a42b..58139fb 100644
--- a/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/AetherVersion.java
+++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/AetherVersion.java
@@ -27,7 +27,7 @@ class AetherVersion
 {
     private final org.eclipse.aether.version.Version version;
 
-    public AetherVersion( String version )
+    AetherVersion( String version )
         throws VersionParseException
     {
         try
diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/MavenArtifactVersion.java
b/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/MavenArtifactVersion.java
index 19ae059..1c379fb 100644
--- a/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/MavenArtifactVersion.java
+++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/versions/MavenArtifactVersion.java
@@ -27,7 +27,7 @@ class MavenArtifactVersion
 {
     private final ArtifactVersion version;
 
-    public MavenArtifactVersion( String version )
+    MavenArtifactVersion( String version )
     {
         this.version = new DefaultArtifactVersion( version );
     }
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
index 259d9a3..edd0e90 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
@@ -35,6 +35,7 @@ import org.apache.maven.shared.release.scm.IdentifiedScm;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.StringUtils;
 import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
 import org.sonatype.plexus.components.cipher.PlexusCipherException;
 import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
@@ -201,6 +202,11 @@ public class PropertiesReleaseDescriptorStore
         {
             properties.setProperty( "exec.pomFileName", config.getPomFileName() );
         }
+        if ( !config.getActivateProfiles().isEmpty() )
+        {
+            properties.setProperty( "exec.activateProfiles",
+                                    StringUtils.join( config.getActivateProfiles().iterator(),
"," ) );
+        }
         if ( config.getPreparationGoals() != null )
         {
             properties.setProperty( "preparationGoals", config.getPreparationGoals() );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
index c2ed277..2bef814 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
@@ -56,6 +56,12 @@ public class ReleaseDescriptorBuilder
         return this;
     }
 
+    public ReleaseDescriptorBuilder setActivateProfiles( List<String> profiles )
+    {
+        releaseDescriptor.setActivateProfiles( profiles );
+        return this;
+    }
+
     public ReleaseDescriptorBuilder setAddSchema( boolean addSchema )
     {
         releaseDescriptor.setAddSchema( addSchema );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
index 36504c2..a355624 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
@@ -19,6 +19,7 @@ package org.apache.maven.shared.release.config;
  * under the License.
  */
 
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Map.Entry;
 import java.util.Properties;
@@ -110,6 +111,10 @@ public class ReleaseUtils
         {
             builder.setPomFileName( properties.getProperty( "exec.pomFileName" ) );
         }
+        if ( properties.containsKey( "exec.activateProfiles" ) )
+        {
+            builder.setActivateProfiles( Arrays.asList( properties.getProperty( "exec.pomFileName"
).split( "," ) ) );
+        }
         if ( properties.containsKey( "preparationGoals" ) )
         {
             builder.setPreparationGoals( properties.getProperty( "preparationGoals" ) );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java
index 214f86b..23d4cce 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java
@@ -97,6 +97,24 @@ public abstract class AbstractRunGoalsPhase
 
     protected abstract String getGoals( ReleaseDescriptor releaseDescriptor );
 
+    protected String getAdditionalArguments( ReleaseDescriptor releaseDescriptor )
+    {
+        StringBuilder builder = new StringBuilder();
+
+        if ( releaseDescriptor.getAdditionalArguments() != null )
+        {
+            builder.append( releaseDescriptor.getAdditionalArguments() );
+        }
+
+        if ( !releaseDescriptor.getActivateProfiles().isEmpty() )
+        {
+            builder.append( " -P " )
+                   .append( StringUtils.join( releaseDescriptor.getActivateProfiles().iterator(),
"," ) );
+        }
+
+        return builder.length() > 0 ? builder.toString().trim() : null;
+    }
+
     /**
      * Determines the path of the working directory. By default, this is the
      * checkout directory. For some SCMs, the project root directory is not the
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
index 76b3834..aab4750 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
@@ -45,7 +45,7 @@ public class RunCompleteGoalsPhase
         throws ReleaseExecutionException
     {
         return execute( releaseDescriptor, releaseEnvironment, new File( releaseDescriptor.getWorkingDirectory()
),
-                        releaseDescriptor.getAdditionalArguments() );
+                        getAdditionalArguments( releaseDescriptor ) );
     }
 
     @Override
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
index 9801c12..0d7af65 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
@@ -52,7 +52,7 @@ public class RunPerformGoalsPhase
                                   List<MavenProject> reactorProjects, boolean simulate
)
         throws ReleaseExecutionException
     {
-        String additionalArguments = releaseDescriptor.getAdditionalArguments();
+        String additionalArguments = getAdditionalArguments( releaseDescriptor );
 
         if ( releaseDescriptor.isUseReleaseProfile() )
         {
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
index 8604219..23db790 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
@@ -44,7 +44,7 @@ public class RunPrepareGoalsPhase
         throws ReleaseExecutionException
     {
         return execute( releaseDescriptor, releaseEnvironment, new File( releaseDescriptor.getWorkingDirectory()
),
-                        releaseDescriptor.getAdditionalArguments() );
+                        getAdditionalArguments( releaseDescriptor ) );
     }
 
     @Override
diff --git a/maven-release-manager/src/main/mdo/release-descriptor.mdo b/maven-release-manager/src/main/mdo/release-descriptor.mdo
index 68e7a68..579842c 100644
--- a/maven-release-manager/src/main/mdo/release-descriptor.mdo
+++ b/maven-release-manager/src/main/mdo/release-descriptor.mdo
@@ -217,18 +217,16 @@
             If set to true, this will set the property "performRelease" to true.
           </description>
         </field>
-<!--         <field> -->
-<!--           <name>originalScmInfo</name> -->
-<!--           <version>1.0.0+</version> -->
-<!--           <type>Map</type> -->
-<!--           <association> -->
-<!--             <type>String</type> -->
-<!--             <multiplicity>*</multiplicity> -->
-<!--           </association> -->
-<!--           <description> -->
-<!--             A map of projects to original SCM information. -->
-<!--           </description> -->
-<!--         </field> -->
+        <field>
+          <name>activateProfiles</name>
+          <version>3.0.0+</version>
+          <type>List</type>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>List of profiles to activate.</description>
+        </field>
         <field>
           <name>workingDirectory</name>
           <version>1.0.0+</version>
diff --git a/maven-release-plugin/pom.xml b/maven-release-plugin/pom.xml
index 091699c..e7cb322 100644
--- a/maven-release-plugin/pom.xml
+++ b/maven-release-plugin/pom.xml
@@ -295,5 +295,25 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>jdk7</id>
+      <activation>
+        <jdk>(,1.7]</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <properties>
+                <https.protocols>${https.protocols}</https.protocols>
+                <arguments>-Dhttps.protocols=${https.protocols}</arguments>
+              </properties>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 </project>
diff --git a/maven-release-plugin/src/it/projects/perform/MRELEASE-459/verify.groovy b/maven-release-plugin/src/it/projects/perform/MRELEASE-459/verify.groovy
index 95da4d8..b6a4bbf 100644
--- a/maven-release-plugin/src/it/projects/perform/MRELEASE-459/verify.groovy
+++ b/maven-release-plugin/src/it/projects/perform/MRELEASE-459/verify.groovy
@@ -20,7 +20,7 @@
 File buildLog = new File( basedir, 'build.log' )
 assert buildLog.exists()
 
-def addArgsExpr = /\Q[DEBUG] Additional arguments: -P\E(.+)\Q-DperformRelease=true -f pom.xml\E/
+def addArgsExpr = /\Q[DEBUG] Additional arguments: \E(?:-Dhttps.protocols=TLSv1.2 )?-P(.+)\Q-DperformRelease=true
-f pom.xml\E/
 def matcher = ( buildLog.getText() =~ addArgsExpr )
 
 // M2:  [DEBUG] Additional arguments: -P custom-release -DperformRelease=true -f pom.xml
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/verify.groovy
index 787aa8f..e0839d3 100644
--- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/verify.groovy
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/verify.groovy
@@ -21,7 +21,7 @@ File releaseProperties = new File( basedir, 'release.properties' )
 assert releaseProperties.exists()
 
 def String execArgs = releaseProperties.filterLine { line ->
-   line.startsWith( 'exec.additionalArguments=' )
+   line.startsWith( 'exec.activateProfiles=' )
 }
 
-assert execArgs.contains( "-P mrelease571" )
+assert execArgs.contains( "mrelease571" )
diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml
index a5b3b1c..216c555 100644
--- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml
+++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml
@@ -37,7 +37,7 @@
           </dependency>
         </dependencies>
         <configuration>
-          <arguments>-Prelease,!mrelease-677 </arguments>
+          <arguments>-Prelease,!mrelease-677 ${arguments}</arguments>
           <preparationGoals>help:all-profiles</preparationGoals>
         </configuration>
       </plugin>
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
index fb46c95..0fdaee4 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
@@ -22,7 +22,8 @@ package org.apache.maven.plugins.release;
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Path;
-import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.maven.artifact.ArtifactUtils;
@@ -185,40 +186,22 @@ public abstract class AbstractReleaseMojo
             descriptor.putOriginalVersion( versionlessKey, project.getVersion() );
         }
 
+        descriptor.setAdditionalArguments( this.arguments );
+
         List<String> profileIds = session.getRequest().getActiveProfiles();
         String additionalProfiles = getAdditionalProfiles();
 
-        String args = this.arguments;
         if ( !profileIds.isEmpty() || StringUtils.isNotBlank( additionalProfiles ) )
         {
-            if ( !StringUtils.isEmpty( args ) )
-            {
-                args += " -P ";
-            }
-            else
-            {
-                args = "-P ";
-            }
-
-            for ( Iterator<String> it = profileIds.iterator(); it.hasNext(); )
-            {
-                args += it.next();
-                if ( it.hasNext() )
-                {
-                    args += ",";
-                }
-            }
-
+            List<String> profiles = new ArrayList<>( profileIds );
+            
             if ( additionalProfiles != null )
             {
-                if ( !profileIds.isEmpty() )
-                {
-                    args += ",";
-                }
-                args += additionalProfiles;
+                profiles.addAll( Arrays.asList( additionalProfiles.split( "," ) ) );
             }
+
+            descriptor.setActivateProfiles( profiles );
         }
-        descriptor.setAdditionalArguments( args );
         
         descriptor.setReleaseStrategyId( releaseStrategyId );
 
diff --git a/pom.xml b/pom.xml
index 4c6255c..447e8a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,8 +24,8 @@
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven-parent</artifactId>
-    <version>27</version>
-    <relativePath>../pom/maven/pom.xml</relativePath>
+    <version>32</version>
+    <relativePath/>
   </parent>
 
   <groupId>org.apache.maven.release</groupId>


Mime
View raw message