Author: mkleint Date: Mon Dec 3 13:44:01 2007 New Revision: 600697 URL: http://svn.apache.org/viewvc?rev=600697&view=rev Log: prevent NPE, use 3.0.9-SNAPSHOT dependencies
Modified: maven/shared/trunk/maven-toolchain/pom.xml maven/shared/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java Modified: maven/shared/trunk/maven-toolchain/pom.xml URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-toolchain/pom.xml?rev=600697&r1=600696&r2=600697&view=diff ============================================================================== --- maven/shared/trunk/maven-toolchain/pom.xml (original) +++ maven/shared/trunk/maven-toolchain/pom.xml Mon Dec 3 13:44:01 2007 @@ -20,12 +20,12 @@ <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.0.9-SNAPSHOT</version> </dependency> <dependency> - <groupId>org.apache.maven.artifact</groupId> + <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> - <version>3.0-SNAPSHOT</version> + <version>2.0.9-SNAPSHOT</version> </dependency> </dependencies> <build> @@ -48,6 +48,37 @@ <model>src/main/mdo/toolchains.xml</model> </configuration> </plugin> + <plugin> + <artifactId>maven-shade-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <version>1.0-alpha-13-SNAPSHOT</version> + <executions> + <execution> + <id>shading</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <artifactSet> + <includes> + <include>${project.groupId}:${project.artifactId}</include> + </includes> + </artifactSet> + <relocations> + <relocation> + <pattern>org.codehaus.plexus.util</pattern> + <excludes> + <exclude>org.codehaus.plexus.util.xml.Xpp3Dom</exclude> + <exclude>org.codehaus.plexus.util.xml.pull.*</exclude> + </excludes> + </relocation> + </relocations> + </configuration> + </execution> + </executions> + </plugin> + </plugins> </build> Modified: maven/shared/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java?rev=600697&r1=600696&r2=600697&view=diff ============================================================================== --- maven/shared/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java (original) +++ maven/shared/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java Mon Dec 3 13:44:01 2007 @@ -24,6 +24,7 @@ import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -148,6 +149,9 @@ private Map retrieveContext( MavenSession session ) { + if (session == null) { + return Collections.EMPTY_MAP; + } PluginDescriptor desc = new PluginDescriptor(); desc.setGroupId( PluginDescriptor.getDefaultPluginGroupId() ); desc.setArtifactId( PluginDescriptor.getDefaultPluginArtifactId ("toolchains") );