Author: bentmann
Date: Wed Nov 11 12:23:29 2009
New Revision: 834849

URL: http://svn.apache.org/viewvc?rev=834849&view=rev
Log:
[MNG-4436] [regression] Singleton components can get instantianted multiple 
times

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
   (with props)
Modified:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/bootstrap/pom.xml
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml

Modified: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=834849&r1=834848&r2=834849&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 (original)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 Wed Nov 11 12:23:29 2009
@@ -85,6 +85,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        // suite.addTestSuite( 
MavenITmng4436SingletonComponentLookupTest.class );
         suite.addTestSuite( MavenITmng4433ForceParentSnapshotUpdateTest.class 
);
         suite.addTestSuite( 
MavenITmng4430DistributionManagementStatusTest.class );
         suite.addTestSuite( 
MavenITmng4429CompRequirementOnNonDefaultImplTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,66 @@
+package org.apache.maven.it;
+
+/*
+ * 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 org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a 
href="http://jira.codehaus.org/browse/MNG-4436";>MNG-4436</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4436SingletonComponentLookupTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4436SingletonComponentLookupTest()
+    {
+        super( "[3.0-alpha-4,)" );
+    }
+
+    /**
+     * Test that lookup of a singleton component works reliably.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4436" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/comp.properties" );
+
+        assertTrue( props.getProperty( "id.0", "" ).length() > 0 );
+
+        assertEquals( props.getProperty( "id.0" ), props.getProperty( "id.1" ) 
);
+        assertEquals( props.getProperty( "id.1" ), props.getProperty( "id.2" ) 
);
+        assertEquals( props.getProperty( "id.2" ), props.getProperty( "id.3" ) 
);
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/bootstrap/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/bootstrap/pom.xml?rev=834849&r1=834848&r2=834849&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/bootstrap/pom.xml
 (original)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/bootstrap/pom.xml
 Wed Nov 11 12:23:29 2009
@@ -254,6 +254,12 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.its.plugins</groupId>
+      <artifactId>maven-it-plugin-singleton-component</artifactId>
+      <version>${itPluginVersion}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.plugins</groupId>
       <artifactId>maven-it-plugin-site</artifactId>
       <version>${itPluginVersion}</version>
       <scope>runtime</scope>

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,55 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4436</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4436</name>
+  <description>
+    Test that lookup of a singleton component works reliably.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-singleton-component</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputFile>target/comp.properties</outputFile>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>it</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4436/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Nov 11 12:23:29 2009
@@ -0,0 +1,7 @@
+target
+*.iml
+.classpath
+.project
+.settings
+target-eclipse
+bin

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,51 @@
+<?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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>maven-it-plugins</artifactId>
+    <groupId>org.apache.maven.its.plugins</groupId>
+    <version>2.1-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>maven-it-plugin-singleton-component</artifactId>
+  <packaging>maven-plugin</packaging>
+
+  <name>Maven Integration Test Plugin :: Singleton Component</name>
+  <description>
+    A test plugin to check that the lookup of a singleton component works 
reliably.
+  </description>
+  <inceptionYear>2009</inceptionYear>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,32 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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.
+ */
+
+/**
+ * A dummy component.
+ * 
+ * @author Benjamin Bentmann
+ */
+public interface Component
+{
+
+    String getId();
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/Component.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,45 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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.
+ */
+
+/**
+ * A stateful singleton.
+ * 
+ * @plexus.component role="org.apache.maven.plugin.coreit.Component" 
role-hint="default"
+ * 
+ * @author Benjamin Bentmann
+ */
+public class DefaultComponent
+    implements Component
+{
+
+    private final String id;
+
+    public DefaultComponent()
+    {
+        id = Integer.toString( System.identityHashCode( this ) );
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/DefaultComponent.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,125 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Requires a singleton component in various ways and dumps the ids to a 
properties file.
+ * 
+ * @goal it
+ * @phase initialize
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class ItMojo
+    extends AbstractMojo
+{
+
+    /**
+     * The path to the output file.
+     * 
+     * @parameter expression="${touch.outputFile}" 
default-value="target/comp.properties"
+     */
+    private File outputFile;
+
+    /**
+     * Component lookup without role hint.
+     * 
+     * @component
+     */
+    private Component componentWithoutRoleHint;
+
+    /**
+     * Component lookup with explicit role hint.
+     * 
+     * @component roleHint="default"
+     */
+    private Component componentWithRoleHint;
+
+    /**
+     * Component lookup via active map.
+     * 
+     * @component role="org.apache.maven.plugin.coreit.Component"
+     */
+    private Map componentMap;
+
+    /**
+     * Component lookup via active list.
+     * 
+     * @component role="org.apache.maven.plugin.coreit.Component"
+     */
+    private List componentList;
+
+    /**
+     * Runs this mojo.
+     * 
+     * @throws MojoExecutionException If the output file could not be created.
+     */
+    public void execute()
+        throws MojoExecutionException
+    {
+        Component componentFromMap = (Component) 
componentMap.values().iterator().next();
+        Component componentFromList = (Component) 
componentList.iterator().next();
+
+        getLog().info( "[MAVEN-CORE-IT-LOG] Using component: " + 
componentWithoutRoleHint );
+        getLog().info( "[MAVEN-CORE-IT-LOG] Using component: " + 
componentWithRoleHint );
+        getLog().info( "[MAVEN-CORE-IT-LOG] Using component: " + 
componentFromMap );
+        getLog().info( "[MAVEN-CORE-IT-LOG] Using component: " + 
componentFromList );
+
+        Properties props = new Properties();
+        props.setProperty( "id.0", componentWithoutRoleHint.getId() );
+        props.setProperty( "id.1", componentWithRoleHint.getId() );
+        props.setProperty( "id.2", componentFromMap.getId() );
+        props.setProperty( "id.3", componentFromList.getId() );
+
+        getLog().info( "[MAVEN-CORE-IT-LOG] Creating output file: " + 
outputFile );
+
+        try
+        {
+            outputFile.getParentFile().mkdirs();
+            FileOutputStream os = new FileOutputStream( outputFile );
+            try
+            {
+                props.store( os, "MAVEN-CORE-IT-LOG" );
+            }
+            finally
+            {
+                os.close();
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "Output file could not be 
created: " + outputFile, e );
+        }
+
+        getLog().info( "[MAVEN-CORE-IT-LOG] Created output file: " + 
outputFile );
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/java/org/apache/maven/plugin/coreit/ItMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml?rev=834849&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
 Wed Nov 11 12:23:29 2009
@@ -0,0 +1,29 @@
+<!--
+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.
+-->
+
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.plugin.coreit.Component</role>
+      <role-hint>default</role-hint>
+      
<implementation>org.apache.maven.plugin.coreit.DefaultComponent</implementation>
+      <instantiation-strategy>singleton</instantiation-strategy>
+    </component>
+  </components>
+</component-set>

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-singleton-component/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml?rev=834849&r1=834848&r2=834849&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml 
(original)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml 
Wed Nov 11 12:23:29 2009
@@ -57,6 +57,7 @@
     <module>maven-it-plugin-plugin-dependency</module>
     <module>maven-it-plugin-project-interpolation</module>
     <module>maven-it-plugin-setter</module>
+    <module>maven-it-plugin-singleton-component</module>
     <module>maven-it-plugin-site</module>
     <module>maven-it-plugin-toolchain</module>
     <module>maven-it-plugin-touch</module>


Reply via email to