You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/04/06 18:56:08 UTC
[maven-invoker] branch stabilize updated: Pass https.protocols
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch stabilize
in repository https://gitbox.apache.org/repos/asf/maven-invoker.git
The following commit(s) were added to refs/heads/stabilize by this push:
new 6f001f8 Pass https.protocols
6f001f8 is described below
commit 6f001f8ddc321ae65f4d94c37c85edea9e019d1f
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Apr 6 20:55:56 2019 +0200
Pass https.protocols
---
.../maven/shared/invoker/DefaultInvokerTest.java | 51 +++++++++++-----------
1 file changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java b/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
index 53a3772..af415bc 100644
--- a/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
+++ b/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
@@ -48,14 +48,7 @@ public class DefaultInvokerTest
request.setBaseDirectory( basedir );
request.setDebug( true );
request.setGoals( Arrays.asList( "clean", "package" ) );
-
- if ( !System.getProperty( "java.version" ).startsWith( "1." ) )
- {
- Properties properties = new Properties();
- properties.put( "maven.compiler.source", "1.7" );
- properties.put( "maven.compiler.target", "1.7" );
- request.setProperties( properties );
- }
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -74,14 +67,8 @@ public class DefaultInvokerTest
request.setBaseDirectory( basedir );
request.setDebug( true );
request.setGoals( Arrays.asList( "clean", "package" ) );
+ request.setProperties( getProperties() );
- if ( !System.getProperty( "java.version" ).startsWith( "1." ) )
- {
- Properties properties = new Properties();
- properties.put( "maven.compiler.source", "1.7" );
- properties.put( "maven.compiler.target", "1.7" );
- request.setProperties( properties );
- }
InvocationResult result = invoker.execute( request );
assertEquals( 1, result.getExitCode() );
@@ -100,14 +87,7 @@ public class DefaultInvokerTest
request.setDebug( true );
request.setGoals( Arrays.asList( "clean", "package" ) );
request.setTimeoutInSeconds( 4 );
-
- if ( !System.getProperty( "java.version" ).startsWith( "1." ) )
- {
- Properties properties = new Properties();
- properties.put( "maven.compiler.source", "1.7" );
- properties.put( "maven.compiler.target", "1.7" );
- request.setProperties( properties );
- }
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -134,7 +114,8 @@ public class DefaultInvokerTest
request.setPomFileName( "pom with spaces.xml" );
request.setDebug( true );
request.setGoals( Arrays.asList( "clean" ) );
-
+ request.setProperties( getProperties() );
+
InvocationResult result = invoker.execute( request );
assertEquals( 0, result.getExitCode() );
@@ -155,6 +136,7 @@ public class DefaultInvokerTest
request.setPomFileName( "pom with spaces & special char.xml" );
request.setDebug( true );
request.setGoals( Arrays.asList( "clean" ) );
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -176,6 +158,7 @@ public class DefaultInvokerTest
request.setUserSettingsFile( new File( basedir, "settings with spaces.xml" ) );
request.setDebug( true );
request.setGoals( Arrays.asList( "validate" ) );
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -197,6 +180,7 @@ public class DefaultInvokerTest
request.setLocalRepositoryDirectory( new File( basedir, "repo with spaces" ) );
request.setDebug( true );
request.setGoals( Arrays.asList( "validate" ) );
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -222,6 +206,7 @@ public class DefaultInvokerTest
request.setProperties( props );
request.setDebug( true );
request.setGoals( Arrays.asList( "validate" ) );
+ request.setProperties( getProperties() );
InvocationResult result = invoker.execute( request );
@@ -303,5 +288,21 @@ public class DefaultInvokerTest
System.out.println( "Starting: " + element.getMethodName() );
}
-
+
+ private Properties getProperties()
+ {
+ Properties properties = new Properties();
+ if ( !System.getProperty( "java.version" ).startsWith( "1." ) )
+ {
+ properties.put( "maven.compiler.source", "1.7" );
+ properties.put( "maven.compiler.target", "1.7" );
+ }
+
+ String httpProtocols = System.getProperty( "https.protocols" );
+ if ( httpProtocols != null )
+ {
+ properties.put( "https.protocols", httpProtocols );
+ }
+ return properties;
+ }
}