You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/08/27 14:46:04 UTC

[1/5] maven git commit: [MNG-6148] Can't package and assemble with JDK9/Jigsaw [Forced Update!]

Repository: maven
Updated Branches:
  refs/heads/MNG-6216 9bd69aa8f -> 99244b097 (forced update)


[MNG-6148] Can't package and assemble with JDK9/Jigsaw


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/842db371
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/842db371
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/842db371

Branch: refs/heads/MNG-6216
Commit: 842db371f0fcaf4e930b99395fb6a8bb442684d6
Parents: 4f2a2db
Author: rfscholte <rf...@apache.org>
Authored: Tue Aug 15 21:42:42 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:42:42 2017 +0200

----------------------------------------------------------------------
 pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/842db371/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 78c375f..8ce59ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -657,6 +657,7 @@ under the License.
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
+            <version>3.0.0-M1</version>
             <configuration>
               <!-- TODO Remove when we upgrade to maven-parent 31 -->
               <locale>en</locale>


[5/5] maven git commit: [MNG-6216] ArrayIndexOutOfBoundsException when parsing POM o Upgraded to new release of plexus-utils which contains the fix for #22 in plexus-utils.

Posted by kh...@apache.org.
[MNG-6216] ArrayIndexOutOfBoundsException when parsing POM
 o Upgraded to new release of plexus-utils which contains
   the fix for #22 in plexus-utils.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/99244b09
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/99244b09
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/99244b09

Branch: refs/heads/MNG-6216
Commit: 99244b097a5d09363126d3722973213b380483d3
Parents: f047ea1
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Thu Aug 3 20:12:25 2017 +0200
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Sun Aug 27 16:44:00 2017 +0200

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/99244b09/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8ce59ed..761edbf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@ under the License.
     <mockitoVersion>1.10.19</mockitoVersion>
     <plexusVersion>1.7.1</plexusVersion>
     <plexusInterpolationVersion>1.24</plexusInterpolationVersion>
-    <plexusUtilsVersion>3.0.24</plexusUtilsVersion>
+    <plexusUtilsVersion>3.1.0</plexusUtilsVersion>
     <guavaVersion>20.0</guavaVersion>
     <guiceVersion>4.0</guiceVersion>
     <sisuInjectVersion>0.3.3</sisuInjectVersion>


[2/5] maven git commit: [MNG-6127] Fix plugin execution configuration interference

Posted by kh...@apache.org.
[MNG-6127] Fix plugin execution configuration interference

Signed-off-by: rfscholte <rf...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f1ed6592
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f1ed6592
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f1ed6592

Branch: refs/heads/MNG-6216
Commit: f1ed6592b1c701834d1377fade6cdb382a63bbf4
Parents: 842db37
Author: Mario Krizmanic <ma...@gmail.com>
Authored: Tue Aug 15 21:46:29 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:46:29 2017 +0200

----------------------------------------------------------------------
 .../internal/DefaultLifecyclePluginAnalyzer.java          | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f1ed6592/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
index aec785f..14653b7 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
@@ -31,6 +31,7 @@ import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -190,8 +191,13 @@ public class DefaultLifecyclePluginAnalyzer
                 execution.setPhase( phase );
                 execution.setPriority( i - mojos.size() );
                 execution.getGoals().add( gs.goal );
-                execution.setConfiguration( mojo.getConfiguration() );
-                
+
+                Xpp3Dom lifecycleConfiguration = mojo.getConfiguration();
+                if ( lifecycleConfiguration != null )
+                {
+                    execution.setConfiguration( new Xpp3Dom( lifecycleConfiguration ) );
+                }
+
                 plugin.setDependencies( mojo.getDependencies() );
                 plugin.getExecutions().add( execution );
             }


[4/5] maven git commit: Squashed commit of the following:

Posted by kh...@apache.org.
Squashed commit of the following:

commit c829bdcfc275b207e23fc568b3c16d98195675be
Author: rfscholte <rf...@apache.org>
Date:   Thu Aug 24 10:54:08 2017 +0200

    [MNG-6275] ServiceLoaderFactory can't find implementations via ClassRealm


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f047ea14
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f047ea14
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f047ea14

Branch: refs/heads/MNG-6216
Commit: f047ea143766fd22ae42040e6805bef287f3cc3e
Parents: 785bad6
Author: rfscholte <rf...@apache.org>
Authored: Thu Aug 24 11:33:01 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Thu Aug 24 11:33:01 2017 +0200

----------------------------------------------------------------------
 .../classrealm/DefaultClassRealmManager.java    |   2 +-
 .../DefaultClassRealmManagerTest.java           | 101 +++++++++++++++++++
 2 files changed, 102 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f047ea14/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
index 6ce1925..d517924 100644
--- a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
+++ b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java
@@ -120,7 +120,7 @@ public class DefaultClassRealmManager
             {
                 try
                 {
-                    ClassRealm classRealm = world.newRealm( realmId, null );
+                    ClassRealm classRealm = world.newRealm( realmId, ClassLoader.getSystemClassLoader() );
 
                     if ( logger.isDebugEnabled() )
                     {

http://git-wip-us.apache.org/repos/asf/maven/blob/f047ea14/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java b/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
new file mode 100644
index 0000000..726199f
--- /dev/null
+++ b/maven-core/src/test/java/org/apache/maven/classrealm/DefaultClassRealmManagerTest.java
@@ -0,0 +1,101 @@
+package org.apache.maven.classrealm;
+
+/*
+ * 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 java.util.ServiceLoader;
+
+import javax.script.ScriptEngineFactory;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.junit.Test;
+
+public class DefaultClassRealmManagerTest extends PlexusTestCase
+{
+    private ClassRealmManager classRealmManager;
+
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+        this.classRealmManager = lookup( ClassRealmManager.class );
+    }
+
+    @Override
+    protected void customizeContainerConfiguration( ContainerConfiguration configuration )
+    {
+        configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+    }
+
+    @Test
+    public void testMNG6275_pluginRealmDefaultParentClassLoader()
+    {
+        Plugin plugin = new Plugin();
+        plugin.setVersion( "VERSION" );
+        
+        ClassLoader parent = null;
+        
+        ClassRealm pluginRealm = classRealmManager.createPluginRealm( plugin, parent, null, null, null );
+        ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, pluginRealm );
+        assertTrue( sef.iterator().hasNext() );
+    }
+
+    @Test
+    public void testMNG6275_extensionRealmDefaultParentClassLoader()
+    {
+        Plugin extension = new Plugin();
+        extension.setVersion( "VERSION" );
+        
+        ClassRealm extensionRealm = classRealmManager.createExtensionRealm( extension, null );
+        ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, extensionRealm );
+        assertTrue( sef.iterator().hasNext() );
+    }
+
+    @Test
+    public void testMNG6275_projectRealmDefaultParentClassLoader()
+    {
+        Model model = new Model();
+        
+        ClassRealm projectRealm = classRealmManager.createProjectRealm( model, null );
+        ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, projectRealm );
+        assertTrue( sef.iterator().hasNext() );
+    }
+
+    @Test
+    public void testMNG6275_mavenApiRealmDefaultParentClassLoader()
+    {
+        ClassRealm mavenApiRealm = classRealmManager.getMavenApiRealm();
+        ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, mavenApiRealm );
+        assertTrue( sef.iterator().hasNext() );
+    }
+
+    @Test
+    public void testMNG6275_coreRealmDefaultParentClassLoader()
+    {
+        ClassRealm coreRealm = classRealmManager.getCoreRealm();
+        ServiceLoader<ScriptEngineFactory> sef = ServiceLoader.load( ScriptEngineFactory.class, coreRealm );
+        assertTrue( sef.iterator().hasNext() );
+    }
+}


[3/5] maven git commit: [MNG-6220] Add CLI options to control color output Introduce -Dstyle.color=[always|never|auto]

Posted by kh...@apache.org.
[MNG-6220] Add CLI options to control color output
Introduce -Dstyle.color=[always|never|auto]


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/785bad69
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/785bad69
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/785bad69

Branch: refs/heads/MNG-6216
Commit: 785bad693c60ad60d7b307af8fab9e9234ff57bd
Parents: f1ed659
Author: rfscholte <rf...@apache.org>
Authored: Tue Aug 15 21:48:57 2017 +0200
Committer: rfscholte <rf...@apache.org>
Committed: Tue Aug 15 21:48:57 2017 +0200

----------------------------------------------------------------------
 maven-embedder/pom.xml                          |  5 ++
 .../java/org/apache/maven/cli/MavenCli.java     | 28 +++++--
 .../java/org/apache/maven/cli/MavenCliTest.java | 86 ++++++++++++++++++--
 3 files changed, 107 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 7bd2650..4b3d097 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -138,6 +138,11 @@ under the License.
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.fusesource.jansi</groupId>
+      <artifactId>jansi</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 641a2a9..3474fab 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -144,6 +144,8 @@ public class MavenCli
 
     private static final String MVN_MAVEN_CONFIG = ".mvn/maven.config";
 
+    public static final String STYLE_COLOR_PROPERTY = "style.color";
+
     private ClassWorld classWorld;
 
     private LoggerManager plexusLoggerManager;
@@ -472,8 +474,9 @@ public class MavenCli
     /**
      * configure logging
      */
-    private void logging( CliRequest cliRequest )
+    void logging( CliRequest cliRequest )
     {
+        // LOG LEVEL
         cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
         cliRequest.quiet = !cliRequest.debug && cliRequest.commandLine.hasOption( CLIManager.QUIET );
         cliRequest.showErrors = cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.ERRORS );
@@ -494,18 +497,33 @@ public class MavenCli
         // else fall back to default log level specified in conf
         // see https://issues.apache.org/jira/browse/MNG-2570
 
-        if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE ) )
+        // LOG COLOR
+        String styleColor = cliRequest.getUserProperties().getProperty( STYLE_COLOR_PROPERTY, "auto" );
+        if ( "always".equals( styleColor ) )
+        {
+            MessageUtils.setColorEnabled( true );
+        }
+        else if ( "never".equals( styleColor ) )
         {
             MessageUtils.setColorEnabled( false );
         }
-
+        else if ( !"auto".equals( styleColor ) )
+        {
+            throw new IllegalArgumentException( "Invalid color configuration option [" + styleColor
+                + "]. Supported values are (auto|always|never)." );
+        }
+        else if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE )
+            || cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
+        {
+            MessageUtils.setColorEnabled( false );
+        }
+        
+        // LOG STREAMS
         if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
         {
             File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
             logFile = resolveFile( logFile, cliRequest.workingDirectory );
 
-            MessageUtils.setColorEnabled( false );
-
             // redirect stdout and stderr to file
             try
             {

http://git-wip-us.apache.org/repos/asf/maven/blob/785bad69/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
index 9b480ea..433c949 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
@@ -19,26 +19,35 @@ package org.apache.maven.cli;
  * under the License.
  */
 
-import junit.framework.TestCase;
-import org.apache.commons.cli.ParseException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
 
 import java.io.File;
 
+import org.apache.commons.cli.ParseException;
+import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 public class MavenCliTest
-    extends TestCase
 {
     private MavenCli cli;
 
     private String origBasedir;
 
-    protected void setUp()
+    @Before
+    public void setUp()
     {
         cli = new MavenCli();
         origBasedir = System.getProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
     }
 
-    @Override
-    protected void tearDown()
+    @After
+    public void tearDown()
         throws Exception
     {
         if ( origBasedir != null )
@@ -49,9 +58,9 @@ public class MavenCliTest
         {
             System.getProperties().remove( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
         }
-        super.tearDown();
     }
 
+    @Test
     public void testCalculateDegreeOfConcurrencyWithCoreMultiplier()
     {
         int cores = Runtime.getRuntime().availableProcessors();
@@ -71,6 +80,7 @@ public class MavenCliTest
         }
     }
 
+    @Test
     public void testMavenConfig()
         throws Exception
     {
@@ -90,6 +100,7 @@ public class MavenCliTest
         assertEquals( "foobar", request.commandLine.getOptionValue( "builder" ) );
     }
 
+    @Test
     public void testMavenConfigInvalid()
         throws Exception
     {
@@ -120,6 +131,7 @@ public class MavenCliTest
      *
      * @throws Exception in case of failure.
      */
+    @Test
     public void testMVNConfigurationThreadCanBeOverwrittenViaCommandLine()
         throws Exception
     {
@@ -145,6 +157,7 @@ public class MavenCliTest
      *
      * @throws Exception
      */
+    @Test
     public void testMVNConfigurationDefinedPropertiesCanBeOverwrittenViaCommandLine()
         throws Exception
     {
@@ -172,6 +185,7 @@ public class MavenCliTest
      *
      * @throws Exception
      */
+    @Test
     public void testMVNConfigurationCLIRepeatedPropertiesLastWins()
         throws Exception
     {
@@ -199,6 +213,7 @@ public class MavenCliTest
      *
      * @throws Exception
      */
+    @Test
     public void testMVNConfigurationFunkyArguments()
         throws Exception
     {
@@ -221,4 +236,61 @@ public class MavenCliTest
 
         assertEquals( "-Dpom.xml", request.getCommandLine().getOptionValue( CLIManager.ALTERNATE_POM_FILE ) );
     }
+
+    @Test
+    public void testStyleColors()
+        throws Exception
+    {
+        assumeTrue( "ANSI not supported", MessageUtils.isColorEnabled() );
+        CliRequest request;
+
+        MessageUtils.setColorEnabled( true );
+        request = new CliRequest( new String[] { "-B" }, null );
+        cli.cli( request );
+        cli.properties( request );
+        cli.logging( request );
+        assertFalse( MessageUtils.isColorEnabled() );
+
+        MessageUtils.setColorEnabled( true );
+        request = new CliRequest( new String[] { "-l", "target/temp/mvn.log" }, null );
+        cli.cli( request );
+        cli.properties( request );
+        cli.logging( request );
+        assertFalse( MessageUtils.isColorEnabled() );
+
+        MessageUtils.setColorEnabled( false );
+        request = new CliRequest( new String[] { "-Dstyle.color=always" }, null );
+        cli.cli( request );
+        cli.properties( request );
+        cli.logging( request );
+        assertTrue( MessageUtils.isColorEnabled() );
+
+        MessageUtils.setColorEnabled( true );
+        request = new CliRequest( new String[] { "-Dstyle.color=never" }, null );
+        cli.cli( request );
+        cli.properties( request );
+        cli.logging( request );
+        assertFalse( MessageUtils.isColorEnabled() );
+
+        MessageUtils.setColorEnabled( false );
+        request = new CliRequest( new String[] { "-Dstyle.color=always", "-B", "-l", "target/temp/mvn.log" }, null );
+        cli.cli( request );
+        cli.properties( request );
+        cli.logging( request );
+        assertTrue( MessageUtils.isColorEnabled() );
+
+        try
+        {
+            MessageUtils.setColorEnabled( false );
+            request = new CliRequest( new String[] { "-Dstyle.color=maybe", "-B", "-l", "target/temp/mvn.log" }, null );
+            cli.cli( request );
+            cli.properties( request );
+            cli.logging( request );
+            fail( "maybe is not a valid option" );
+        }
+        catch ( IllegalArgumentException e )
+        {
+            // noop
+        }
+    }
 }