[MREPOSITORY-19] Adding more ITs.

git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@820164 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index c447453..1f3d109 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,12 +38,13 @@
   <prerequisites>
     <maven>2.0.6</maven>
   </prerequisites>
-
+  
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-repository-plugin/</connection>
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-repository-plugin/</developerConnection>
     <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/</url>
   </scm>
+  
   <issueManagement>
     <system>JIRA</system>
     <url>http://jira.codehaus.org/browse/MREPOSITORY</url>
@@ -143,6 +144,11 @@
   <profiles>
     <profile>
       <id>run-its</id>
+      
+      <properties>
+        <localRepositoryUrl>${project.build.directory}/it-repo</localRepositoryUrl>
+      </properties>
+      
       <build>
         <testResources>
           <testResource>
diff --git a/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml b/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml
new file mode 100644
index 0000000..38bd76b
--- /dev/null
+++ b/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.repository</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../../it-parent/pom.xml</relativePath>
+  </parent>
+  
+  <groupId>org.apache.maven.its.repository</groupId>
+  <artifactId>bundle-pack-target-no-scm</artifactId>
+  <version>1.0</version>
+  
+  <name>bundle-pack Target without SCM</name>
+  <description>Target for the bundle:bundle-pack goal ITs that is missing the SCM section</description>
+  
+  <url>http://maven.apache.org/plugins/maven-repository-plugin/test</url>
+  
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+</project>
diff --git a/src/it/bootstrap/bundle-pack-target-no-scm/src/main/resources/foo.txt b/src/it/bootstrap/bundle-pack-target-no-scm/src/main/resources/foo.txt
new file mode 100644
index 0000000..bc56c4d
--- /dev/null
+++ b/src/it/bootstrap/bundle-pack-target-no-scm/src/main/resources/foo.txt
@@ -0,0 +1 @@
+Foo
diff --git a/src/it/bootstrap/bundle-pack-target/pom.xml b/src/it/bootstrap/bundle-pack-target/pom.xml
new file mode 100644
index 0000000..f78bee9
--- /dev/null
+++ b/src/it/bootstrap/bundle-pack-target/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.repository</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../../it-parent/pom.xml</relativePath>
+  </parent>
+  
+  <groupId>org.apache.maven.its.repository</groupId>
+  <artifactId>bundle-pack-target</artifactId>
+  <version>1.0</version>
+  
+  <name>bundle-pack Target</name>
+  <description>Target for the bundle:bundle-pack goal ITs</description>
+  
+  <url>http://maven.apache.org/plugins/maven-repository-plugin/test</url>
+  
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+  
+  <scm>
+    <url>http://foo/</url>
+    <connection>scm:svn:http://foo/</connection>
+  </scm>
+</project>
diff --git a/src/it/bootstrap/bundle-pack-target/src/main/resources/foo.txt b/src/it/bootstrap/bundle-pack-target/src/main/resources/foo.txt
new file mode 100644
index 0000000..bc56c4d
--- /dev/null
+++ b/src/it/bootstrap/bundle-pack-target/src/main/resources/foo.txt
@@ -0,0 +1 @@
+Foo
diff --git a/src/it/bootstrap/pom.xml b/src/it/bootstrap/pom.xml
new file mode 100644
index 0000000..028910d
--- /dev/null
+++ b/src/it/bootstrap/pom.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.apache.maven.its.repository</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../it-parent/pom.xml</relativePath>
+  </parent>
+  
+  <artifactId>bootstrap</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>bundle-pack-target</module>
+    <module>bundle-pack-target-no-scm</module>
+  </modules>
+</project>
\ No newline at end of file
diff --git a/src/it/bundle-create-no-scm/pom.xml b/src/it/bundle-create-no-scm/pom.xml
new file mode 100644
index 0000000..470383b
--- /dev/null
+++ b/src/it/bundle-create-no-scm/pom.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.repository</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../it-parent/pom.xml</relativePath>
+  </parent>
+  
+  <artifactId>test</artifactId>
+  <version>1.0</version>
+  <packaging>jar</packaging>
+
+  <name>Test</name>
+  <description>
+    Tests the creation of a simple bundle.
+  </description>
+  <url>http://maven.apache.org/</url>
+
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/MREPOSITORY</url>
+  </issueManagement>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.0.4</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/bundle-create-no-scm/src/main/java/Main.java b/src/it/bundle-create-no-scm/src/main/java/Main.java
new file mode 100644
index 0000000..4f73ddb
--- /dev/null
+++ b/src/it/bundle-create-no-scm/src/main/java/Main.java
@@ -0,0 +1,6 @@
+/**
+ * Appliation entry point.
+ */
+public class Main
+{
+}
diff --git a/src/it/bundle-create/pom.xml b/src/it/bundle-create/pom.xml
index c095cc2..88706b0 100644
--- a/src/it/bundle-create/pom.xml
+++ b/src/it/bundle-create/pom.xml
@@ -22,7 +22,13 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <groupId>org.apache.maven.its.repository</groupId>
+  <parent>
+    <groupId>org.apache.maven.its.repository</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../it-parent/pom.xml</relativePath>
+  </parent>
+  
   <artifactId>test</artifactId>
   <version>1.0</version>
   <packaging>jar</packaging>
diff --git a/src/it/bundle-pack/placeholder.txt b/src/it/bundle-pack/placeholder.txt
index 7936e82..9aafbd3 100644
--- a/src/it/bundle-pack/placeholder.txt
+++ b/src/it/bundle-pack/placeholder.txt
@@ -1,28 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>org.apache.maven.its.repository</groupId>
-  <artifactId>test</artifactId>
-  <version>1.0</version>
-</project>
+this is just a placeholder file.
\ No newline at end of file
diff --git a/src/it/it-parent/pom.xml b/src/it/it-parent/pom.xml
new file mode 100644
index 0000000..68bd373
--- /dev/null
+++ b/src/it/it-parent/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.repository</groupId>
+  <artifactId>it-parent</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+  
+  <repositories>
+    <repository>
+      <id>local.central</id>
+      <url>@localRepositoryUrl@</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <id>local.central</id>
+      <url>@localRepositoryUrl@</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
+</project>
\ No newline at end of file
diff --git a/src/test/java/org/apache/maven/plugins/repository/it/BundleCreateIT.java b/src/test/java/org/apache/maven/plugins/repository/it/BundleCreateIT.java
index 3b7eeed..4e584c7 100644
--- a/src/test/java/org/apache/maven/plugins/repository/it/BundleCreateIT.java
+++ b/src/test/java/org/apache/maven/plugins/repository/it/BundleCreateIT.java
@@ -2,6 +2,7 @@
 
 import static org.apache.maven.plugins.repository.it.support.IntegrationTestUtils.getTestDir;
 import static org.apache.maven.plugins.repository.testutil.Assertions.assertZipContents;
+import static junit.framework.Assert.fail;
 
 import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
@@ -13,6 +14,7 @@
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 public class BundleCreateIT
@@ -20,7 +22,7 @@
     
     @SuppressWarnings( "unchecked" )
     @Test
-    public void run()
+    public void createWithSCMInfoProvided()
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = getTestDir( "bundle-create" );
@@ -32,6 +34,8 @@
         String prefix = IntegrationTestUtils.getCliPluginPrefix();
         
         verifier.executeGoal( prefix + "bundle-create" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
         
         File bundleSource = new File( dir, "target/test-1.0-bundle.jar" );
         
@@ -43,4 +47,35 @@
         assertZipContents( requiredEntries, Assertions.EMPTY_ENTRY_NAMES, bundleSource );
     }
 
+    @SuppressWarnings( "unchecked" )
+    @Test
+    public void createWithSCMInfoMissing()
+        throws IOException, URISyntaxException, VerificationException
+    {
+        File dir = getTestDir( "bundle-create-no-scm" );
+        
+        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        
+        List<String> cliOptions = verifier.getCliOptions();
+        cliOptions.add( "--settings ../settings.xml" );
+        
+        String prefix = IntegrationTestUtils.getCliPluginPrefix();
+        
+        try
+        {
+            verifier.executeGoal( prefix + "bundle-create" );
+            verifier.verifyErrorFreeLog();
+            
+            fail( "No SCM Section provided, build should fail." );
+        }
+        catch( VerificationException e )
+        {
+            // expected, since POM doesn't supply a SCM section.
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
+    }
+
 }
diff --git a/src/test/java/org/apache/maven/plugins/repository/it/BundlePackIT.java b/src/test/java/org/apache/maven/plugins/repository/it/BundlePackIT.java
index 4486cdf..2b6943e 100644
--- a/src/test/java/org/apache/maven/plugins/repository/it/BundlePackIT.java
+++ b/src/test/java/org/apache/maven/plugins/repository/it/BundlePackIT.java
@@ -1,12 +1,14 @@
 package org.apache.maven.plugins.repository.it;
 
+import static org.apache.maven.plugins.repository.it.support.IntegrationTestUtils.bootstrap;
+import static org.apache.maven.plugins.repository.it.support.IntegrationTestUtils.getCliPluginPrefix;
 import static org.apache.maven.plugins.repository.it.support.IntegrationTestUtils.getTestDir;
 import static org.apache.maven.plugins.repository.testutil.Assertions.assertZipContents;
 
 import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
-import org.apache.maven.plugins.repository.it.support.IntegrationTestUtils;
 import org.apache.maven.plugins.repository.testutil.Assertions;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
@@ -18,15 +20,27 @@
 
 public class BundlePackIT
 {
+    
+    @BeforeClass
+    public static void doBootstrap()
+        throws VerificationException, IOException, URISyntaxException
+    {
+        bootstrap();
+    }
 
     @SuppressWarnings( "unchecked" )
     @Test
-    public void run()
+    public void packWithSCMInfoProvided()
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = getTestDir( "bundle-pack" );
         
-        File bundleSource = new File( dir, "junit-4.5-bundle.jar" );
+        String prefix = getCliPluginPrefix();
+        String artifactId = "bundle-pack-target";
+        String groupId = "org.apache.maven.its.repository";
+        String version = "1.0";
+
+        File bundleSource = new File( dir, artifactId + "-" + version + "-bundle.jar" );
 
         if ( bundleSource.exists() )
         {
@@ -38,19 +52,63 @@
         verifier.setAutoclean( false );
 
         List<String> cliOptions = verifier.getCliOptions();
-        cliOptions.add( "-DgroupId=junit" );
-        cliOptions.add( "-DartifactId=junit" );
-        cliOptions.add( "-Dversion=4.5" );
-        cliOptions.add( "-DscmUrl=http://foo" );
-        cliOptions.add( "-DscmConnection=scm:svn:http://foo" );
-
-        String prefix = IntegrationTestUtils.getCliPluginPrefix();
+        cliOptions.add( "-DgroupId=" + groupId );
+        cliOptions.add( "-DartifactId=" + artifactId );
+        cliOptions.add( "-Dversion=" + version );
 
         verifier.executeGoal( prefix + "bundle-pack" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
 
         Set<String> requiredEntries = new HashSet<String>();
         requiredEntries.add( "pom.xml" );
-        requiredEntries.add( "junit-4.5.jar" );
+        requiredEntries.add( artifactId + "-" + version + ".jar" );
+        
+        if ( !verifier.isMavenDebug() )
+        {
+            bundleSource.deleteOnExit();
+        }
+
+        assertZipContents( requiredEntries, Assertions.EMPTY_ENTRY_NAMES, bundleSource );
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Test
+    public void packWithSCMInfoMissing()
+        throws IOException, URISyntaxException, VerificationException
+    {
+        File dir = getTestDir( "bundle-pack" );
+        
+        String prefix = getCliPluginPrefix();
+        String artifactId = "bundle-pack-target-no-scm";
+        String groupId = "org.apache.maven.its.repository";
+        String version = "1.0";
+
+        File bundleSource = new File( dir, artifactId + "-" + version + "-bundle.jar" );
+
+        if ( bundleSource.exists() )
+        {
+            bundleSource.delete();
+        }
+        
+        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        
+        verifier.setAutoclean( false );
+
+        List<String> cliOptions = verifier.getCliOptions();
+        cliOptions.add( "-DgroupId=" + groupId );
+        cliOptions.add( "-DartifactId=" + artifactId );
+        cliOptions.add( "-Dversion=" + version );
+        cliOptions.add( "-DscmUrl=http://foo/" );
+        cliOptions.add( "-DscmConnection=scm:svn:http://foo/" );
+
+        verifier.executeGoal( prefix + "bundle-pack" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Set<String> requiredEntries = new HashSet<String>();
+        requiredEntries.add( "pom.xml" );
+        requiredEntries.add( artifactId + "-" + version + ".jar" );
         
         if ( !verifier.isMavenDebug() )
         {
diff --git a/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java b/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
index a975276..9e94ae3 100644
--- a/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
+++ b/src/test/java/org/apache/maven/plugins/repository/it/support/IntegrationTestUtils.java
@@ -2,6 +2,8 @@
 
 import static org.codehaus.plexus.util.IOUtil.close;
 
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.Verifier;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -16,9 +18,35 @@
 
 public class IntegrationTestUtils
 {
-    
+
     private static String cliPluginPrefix;
+
+    private static String pluginVersion;
+
+    private static String pluginGroupId;
+
+    private static String pluginArtifactId;
     
+    private static boolean installed = false;
+    
+    public static void bootstrap()
+        throws VerificationException, IOException, URISyntaxException
+    {
+        if ( !installed )
+        {
+            File bootstrapDir = getTestDir( "bootstrap" );
+            
+            Verifier verifier = new Verifier( bootstrapDir.getAbsolutePath() );
+            
+            verifier.executeGoal( "install" );
+            
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+            
+            installed = true;
+        }
+    }
+
     public static File getTestDir( final String name )
         throws IOException, URISyntaxException
     {
@@ -46,43 +74,83 @@
         }
     }
 
+    public static String getPluginVersion()
+        throws IOException
+    {
+        if ( pluginVersion == null )
+        {
+            initPluginInfo();
+        }
+
+        return pluginVersion;
+    }
+
+    public static String getPluginGroupId()
+        throws IOException
+    {
+        if ( pluginGroupId == null )
+        {
+            initPluginInfo();
+        }
+
+        return pluginGroupId;
+    }
+
+    public static String getPluginArtifactId()
+        throws IOException
+    {
+        if ( pluginArtifactId == null )
+        {
+            initPluginInfo();
+        }
+
+        return pluginArtifactId;
+    }
+
     public static String getCliPluginPrefix()
         throws IOException
     {
         if ( cliPluginPrefix == null )
         {
-            URL resource = Thread.currentThread().getContextClassLoader().getResource( "META-INF/maven/plugin.xml" );
+            initPluginInfo();
+        }
 
-            InputStream stream = null;
+        return cliPluginPrefix;
+    }
+
+    private static void initPluginInfo()
+        throws IOException
+    {
+        URL resource = Thread.currentThread().getContextClassLoader().getResource( "META-INF/maven/plugin.xml" );
+
+        InputStream stream = null;
+        try
+        {
+            stream = resource.openStream();
+            Xpp3Dom pluginDom;
             try
             {
-                stream = resource.openStream();
-                Xpp3Dom pluginDom;
-                try
-                {
-                    pluginDom = Xpp3DomBuilder.build( new InputStreamReader( stream ) );
-                }
-                catch ( XmlPullParserException e )
-                {
-                    IOException err = new IOException( "Failed to parse plugin descriptor for groupId:artifactId:version prefix. Reason: " + e.getMessage() );
-                    err.initCause( e );
-                    
-                    throw err;
-                }
-                
-
-                String artifactId = pluginDom.getChild( "artifactId" ).getValue();
-                String groupId = pluginDom.getChild( "groupId" ).getValue();
-                String version = pluginDom.getChild( "version" ).getValue();
-                
-                cliPluginPrefix = groupId + ":" + artifactId + ":" + version + ":";
+                pluginDom = Xpp3DomBuilder.build( new InputStreamReader( stream ) );
             }
-            finally
+            catch ( XmlPullParserException e )
             {
-                close( stream );
+                IOException err = new IOException(
+                                                   "Failed to parse plugin descriptor for groupId:artifactId:version prefix. Reason: "
+                                                       + e.getMessage() );
+                err.initCause( e );
+
+                throw err;
             }
+
+            pluginArtifactId = pluginDom.getChild( "artifactId" ).getValue();
+            pluginGroupId = pluginDom.getChild( "groupId" ).getValue();
+            pluginVersion = pluginDom.getChild( "version" ).getValue();
+
+            cliPluginPrefix = pluginGroupId + ":" + pluginArtifactId + ":" + pluginVersion + ":";
         }
-        
-        return cliPluginPrefix;
+        finally
+        {
+            close( stream );
+        }
     }
 }