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

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

commit eeef35777425204c46874f0d9946bbab2b58660f
Author: rfscholte <rfscho...@apache.org>
AuthorDate: Fri Aug 10 11:29:19 2018 +0200

    [ARCHETYPE-553] Allow additional properties for IntegrationTestMojo's 
MavenInvoker
---
 maven-archetype-plugin/pom.xml                      |  4 ++++
 .../pom.xml                                         |  5 ++++-
 .../build-archetype-ignore-eol-encoding/pom.xml     |  5 ++++-
 .../src/it/projects/build-archetype/pom.xml         |  6 +++++-
 .../maven/archetype/mojos/IntegrationTestMojo.java  | 21 +++++++++++++++++++++
 5 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/maven-archetype-plugin/pom.xml b/maven-archetype-plugin/pom.xml
index fccb897..d3435ba 100644
--- a/maven-archetype-plugin/pom.xml
+++ b/maven-archetype-plugin/pom.xml
@@ -232,6 +232,10 @@
                 
<repository.proxy.url>${mrm.repository.url}</repository.proxy.url>
                 
<archetype-repo.proxy.url>${archetype-repo.proxy.url}</archetype-repo.proxy.url>
               </filterProperties>
+              <properties>
+                <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting 
with Central -->
+                <https.protocols>${https.protocols}</https.protocols>
+              </properties>
             </configuration>
             <executions>
               <execution>
diff --git 
a/maven-archetype-plugin/src/it/projects/build-archetype-and-run-its-with-existing-parent/pom.xml
 
b/maven-archetype-plugin/src/it/projects/build-archetype-and-run-its-with-existing-parent/pom.xml
index d9ef111..4261595 100644
--- 
a/maven-archetype-plugin/src/it/projects/build-archetype-and-run-its-with-existing-parent/pom.xml
+++ 
b/maven-archetype-plugin/src/it/projects/build-archetype-and-run-its-with-existing-parent/pom.xml
@@ -53,8 +53,11 @@ under the License.
             <settingsFile>${basedir}/test-settings.xml</settingsFile>
             
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
             <ignoreEOLStyle>true</ignoreEOLStyle>
+            <properties>
+               <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting 
with Central -->
+              <https.protocols>${https.protocols}</https.protocols>
+            </properties>
           </configuration>
-
         </plugin>
         <plugin>
           <artifactId>maven-resources-plugin</artifactId>
diff --git 
a/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/pom.xml
 
b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/pom.xml
index 833ee27..ae35464 100644
--- 
a/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/pom.xml
+++ 
b/maven-archetype-plugin/src/it/projects/build-archetype-ignore-eol-encoding/pom.xml
@@ -56,8 +56,11 @@ under the License.
           <configuration>
             <settingsFile>${basedir}/test-settings.xml</settingsFile>
             
<localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
+            <properties>
+               <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting 
with Central -->
+              <https.protocols>${https.protocols}</https.protocols>
+            </properties>
           </configuration>
-
         </plugin>
         <plugin>
           <artifactId>maven-resources-plugin</artifactId>
diff --git a/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml 
b/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
index 31b8dad..37f7aef 100644
--- a/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
+++ b/maven-archetype-plugin/src/it/projects/build-archetype/pom.xml
@@ -50,11 +50,15 @@ under the License.
           <artifactId>maven-archetype-plugin</artifactId>
           <version>@project.version@</version>
           <configuration>
+            <debug>true</debug>
             <settingsFile>${basedir}/test-settings.xml</settingsFile>
             
<localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
             <ignoreEOLStyle>true</ignoreEOLStyle>
+            <properties>
+               <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting 
with Central -->
+              <https.protocols>${https.protocols}</https.protocols>
+            </properties>
           </configuration>
-
         </plugin>
         <plugin>
           <artifactId>maven-resources-plugin</artifactId>
diff --git 
a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
 
b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
index d1d1ba0..32e9815 100644
--- 
a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
+++ 
b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
@@ -270,6 +270,14 @@ public class IntegrationTestMojo
     @Parameter( property = "archetype.test.settingsFile" )
     private File settingsFile;
 
+    /**
+     * Common set of properties to pass in on each project's command line, via 
-D parameters.
+     *
+     * @since 3.0.2
+     */
+    @Parameter
+    private Map<String, String> properties = new HashMap<String, String>();
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -656,6 +664,19 @@ public class IntegrationTestMojo
 
                 request.setOutputHandler( logger );
             }
+            
+            if ( !properties.isEmpty() )
+            {
+                Properties props = new Properties();
+                for ( Map.Entry<String, String> entry : properties.entrySet() )
+                {
+                    if ( entry.getValue() != null )
+                    {
+                        props.setProperty( entry.getKey(), entry.getValue() );
+                    }
+                }
+                request.setProperties( props );
+            }
 
             File interpolatedSettingsFile = null;
             if ( settingsFile != null )

Reply via email to