You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2015/09/12 00:45:14 UTC

[1/2] maven git commit: Switch to official Guice 4.0

Repository: maven
Updated Branches:
  refs/heads/master 31e70dba9 -> 545c6e268


Switch to official Guice 4.0

Signed-off-by: Jason van Zyl <ja...@tesla.io>

closes #45


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

Branch: refs/heads/master
Commit: 545c6e2685ca238cde4944f8179a3f3fbffa07ae
Parents: 9f7971d
Author: Stuart McCulloch <mc...@gmail.com>
Authored: Wed Apr 29 00:38:57 2015 +0100
Committer: Jason van Zyl <ja...@tesla.io>
Committed: Fri Sep 11 18:36:02 2015 -0400

----------------------------------------------------------------------
 maven-aether-provider/pom.xml |  4 ++--
 maven-core/pom.xml            |  4 ++--
 maven-model-builder/pom.xml   |  4 ++--
 pom.xml                       | 10 +++++-----
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/545c6e26/maven-aether-provider/pom.xml
----------------------------------------------------------------------
diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml
index 0995155..274a318 100644
--- a/maven-aether-provider/pom.xml
+++ b/maven-aether-provider/pom.xml
@@ -71,8 +71,8 @@ under the License.
       <artifactId>plexus-utils</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.sonatype.sisu</groupId>
-      <artifactId>sisu-guice</artifactId>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>
       <optional>true</optional>
       <exclusions>

http://git-wip-us.apache.org/repos/asf/maven/blob/545c6e26/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 87e2e3a..4876a0b 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -81,8 +81,8 @@
       <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.sonatype.sisu</groupId>
-      <artifactId>sisu-guice</artifactId>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/545c6e26/maven-model-builder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index 47ee2ba..03bbdee 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -59,8 +59,8 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.sonatype.sisu</groupId>
-      <artifactId>sisu-guice</artifactId>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/545c6e26/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b24c40f..35efc7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,7 +52,7 @@
     <plexusUtilsVersion>3.0.22</plexusUtilsVersion>
     <!-- Latest version of Guava that works with Sisu -->
     <guavaVersion>18.0</guavaVersion>
-    <guiceVersion>3.2.5</guiceVersion>
+    <guiceVersion>4.0</guiceVersion>
     <sisuInjectVersion>0.3.1</sisuInjectVersion>
     <wagonVersion>2.9</wagonVersion> <!-- Verify SNAPSHOT for MNG-5605 -->
     <securityDispatcherVersion>1.3</securityDispatcherVersion>
@@ -216,13 +216,13 @@
         <version>${guavaVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.sonatype.sisu</groupId>
-        <artifactId>sisu-guice</artifactId>
+        <groupId>com.google.inject</groupId>
+        <artifactId>guice</artifactId>
         <version>${guiceVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.sonatype.sisu</groupId>
-        <artifactId>sisu-guice</artifactId>
+        <groupId>com.google.inject</groupId>
+        <artifactId>guice</artifactId>
         <version>${guiceVersion}</version>
         <classifier>no_aop</classifier>
       </dependency>


[2/2] maven git commit: MNG-5805: Fix NPE in LifecyclePhase#toString()

Posted by jv...@apache.org.
MNG-5805: Fix NPE in LifecyclePhase#toString()

Signed-off-by: Jason van Zyl <ja...@tesla.io>

closes #62


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

Branch: refs/heads/master
Commit: 9f7971dadbec8882b4c119345494b620d3a1f897
Parents: 31e70db
Author: Anton Tanasenko <at...@gmail.com>
Authored: Sat Aug 1 17:02:52 2015 +0300
Committer: Jason van Zyl <ja...@tesla.io>
Committed: Fri Sep 11 18:36:02 2015 -0400

----------------------------------------------------------------------
 .../maven/lifecycle/mapping/LifecyclePhase.java | 35 ++++++----
 .../lifecycle/mapping/LifecyclePhaseTest.java   | 73 ++++++++++++++++++++
 2 files changed, 94 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/9f7971da/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
index d9afcf5..059f234 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
@@ -55,13 +55,16 @@ public class LifecyclePhase
     {
         mojos = new ArrayList<>();
         
-        String[] mojoGoals = StringUtils.split( goals, "," );
-        
-        for ( String mojoGoal: mojoGoals )
+        if ( StringUtils.isNotEmpty( goals ) )
         {
-            LifecycleMojo lifecycleMojo = new LifecycleMojo();
-            lifecycleMojo.setGoal( mojoGoal.trim() );
-            mojos.add( lifecycleMojo );
+            String[] mojoGoals = StringUtils.split( goals, "," );
+            
+            for ( String mojoGoal: mojoGoals )
+            {
+                LifecycleMojo lifecycleMojo = new LifecycleMojo();
+                lifecycleMojo.setGoal( mojoGoal.trim() );
+                mojos.add( lifecycleMojo );
+            }
         }
     }
     
@@ -70,17 +73,21 @@ public class LifecyclePhase
     {
         StringBuilder sb = new StringBuilder();
         boolean first = true;
-        for ( LifecycleMojo mojo: getMojos() )
+        List<LifecycleMojo> mojos = getMojos();
+        if ( mojos != null )
         {
-            if ( first )
-            {
-                first = false;
-            }
-            else
+            for ( LifecycleMojo mojo: mojos )
             {
-                sb.append( "," );
+                if ( first )
+                {
+                    first = false;
+                }
+                else
+                {
+                    sb.append( "," );
+                }
+                sb.append( mojo.getGoal() );
             }
-            sb.append( mojo.getGoal() );
         }
         return sb.toString();
     }

http://git-wip-us.apache.org/repos/asf/maven/blob/9f7971da/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java
new file mode 100644
index 0000000..0d8cbdc
--- /dev/null
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java
@@ -0,0 +1,73 @@
+package org.apache.maven.lifecycle.mapping;
+
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+/**
+ * @author atanasenko
+ */
+public class LifecyclePhaseTest
+{
+    @Test
+    public void testToString()
+    {
+        LifecyclePhase phase = new LifecyclePhase();
+        assertEquals( "", phase.toString() );
+        
+        LifecycleMojo mojo1 = new LifecycleMojo();
+        mojo1.setGoal( "jar:jar" );
+        phase.setMojos( Arrays.asList( mojo1 ) );
+        assertEquals( "jar:jar", phase.toString()  );
+        
+        LifecycleMojo mojo2 = new LifecycleMojo();
+        mojo2.setGoal( "war:war" );
+        phase.setMojos( Arrays.asList( mojo1, mojo2 ) );
+        assertEquals( "jar:jar,war:war", phase.toString() );
+    }
+    
+    @Test
+    public void testSet()
+    {
+        LifecyclePhase phase = new LifecyclePhase();
+        assertNull( phase.getMojos() );
+        
+        phase.set( "" );
+        assertNotNull( phase.getMojos() );
+        assertEquals( 0, phase.getMojos().size() );
+        
+        phase.set( "jar:jar, war:war" );
+        
+        List<LifecycleMojo> mojos = phase.getMojos();
+        assertNotNull( mojos );
+        assertEquals( 2, mojos.size() );
+        
+        LifecycleMojo mojo1 = mojos.get(0);
+        assertNotNull( mojo1 );
+        assertEquals( "jar:jar", mojo1.getGoal() );
+        
+        LifecycleMojo mojo2 = mojos.get(1);
+        assertNotNull( mojo2 );
+        assertEquals( "war:war", mojo2.getGoal() );
+    }
+}
+