You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/02/17 16:12:42 UTC

svn commit: r628492 [1/2] - in /maven/plugin-tools/trunk: ./ maven-plugin-plugin/ maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/ maven-plugin-plugin/src/main/mdo/ maven-plugin-plugin/src/main/resources/ maven-plugin-plugin/src/site/ ...

Author: vsiveton
Date: Sun Feb 17 07:12:38 2008
New Revision: 628492

URL: http://svn.apache.org/viewvc?rev=628492&view=rev
Log:
o fixed svn properties

Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report_fr.properties   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/examples/generate-descriptor.apt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/index.apt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/usage.apt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/site/fml/faq.fml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/site/site.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactRepository.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactResolver.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ArtifactStubFactoryTest.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ExpressionEvaluatorMojo.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ExpressionEvaluatorTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/TestSilentLog.java   (contents, props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/pom.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/MojoDescriptorExtractor.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/Generator.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/MojoScanner.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/util/PluginUtils.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/resources/META-INF/plexus/components.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginXdocGeneratorTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScannerTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/ScannerTestExtractor.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/TestExtractor.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/PluginUtilsTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/TestUtils.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/resources/META-INF/plexus/scannerTestComponents.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/resources/test.txt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/test/resources/testExcludes.txt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-beanshell/src/main/resources/extractor.bsh   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/pom.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/resources/META-INF/plexus/components.xml   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/dir-flag.txt   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/JavaExtractorTestOne.java   (props changed)
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/JavaExtractorTestTwo.java   (props changed)
    maven/plugin-tools/trunk/pom.xml   (props changed)

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Author Date Id Revision
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Author Date Id Revision
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Author Date Id Revision
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo?rev=628492&r1=628491&r2=628492&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo Sun Feb 17 07:12:38 2008
@@ -1,78 +1,78 @@
-<?xml version="1.0"?>
-
-<!--
-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.
--->
-
-<model>
-  <id>pluginRequirements</id>
-  <name>PluginRequirements</name>
-  <description><![CDATA[Model to specify plugin requirements.]]></description>
-  <defaults>
-    <default>
-      <key>package</key>
-      <value>org.apache.maven.plugin.plugin</value>
-    </default>
-  </defaults>
-  <classes>
-    <class>
-      <name>Requirements</name>
-      <description>Plugin requirements.</description>
-      <version>1.0.0</version>
-      <fields>
-        <field>
-          <name>maven</name>
-          <description>The minimum version of Maven to run this plugin.</description>
-          <version>1.0.0</version>
-          <type>String</type>
-          <identifier>true</identifier>
-          <defaultValue>2.0</defaultValue>
-        </field>
-        <field>
-          <name>jdk</name>
-          <description>The minimum version of the JDK to run this plugin.</description>
-          <version>1.0.0</version>
-          <type>String</type>
-          <identifier>true</identifier>
-        </field>
-        <field>
-          <name>memory</name>
-          <description>The minimum memory needed to run this plugin.</description>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>diskSpace</name>
-          <description>The minimum diskSpace needed to run this plugin.</description>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>others</name>
-          <description>Others requirements properties.</description>
-          <version>1.0.0</version>
-          <type>Properties</type>
-          <association xml.mapStyle="inline">
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>
-      </fields>
-    </class>
-  </classes>
-</model>
+<?xml version="1.0"?>
+
+<!--
+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.
+-->
+
+<model>
+  <id>pluginRequirements</id>
+  <name>PluginRequirements</name>
+  <description><![CDATA[Model to specify plugin requirements.]]></description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.plugin.plugin</value>
+    </default>
+  </defaults>
+  <classes>
+    <class>
+      <name>Requirements</name>
+      <description>Plugin requirements.</description>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>maven</name>
+          <description>The minimum version of Maven to run this plugin.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
+          <defaultValue>2.0</defaultValue>
+        </field>
+        <field>
+          <name>jdk</name>
+          <description>The minimum version of the JDK to run this plugin.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>memory</name>
+          <description>The minimum memory needed to run this plugin.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>diskSpace</name>
+          <description>The minimum diskSpace needed to run this plugin.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>others</name>
+          <description>Others requirements properties.</description>
+          <version>1.0.0</version>
+          <type>Properties</type>
+          <association xml.mapStyle="inline">
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report_fr.properties
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/examples/generate-descriptor.apt
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/index.apt
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/site/apt/usage.apt
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/site/fml/faq.fml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/site/site.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 17 07:12:38 2008
@@ -1 +1 @@
-Date Id
+"Author Date Id Revision"

Modified: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java?rev=628492&r1=628491&r2=628492&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java Sun Feb 17 07:12:38 2008
@@ -1,484 +1,484 @@
-package org.apache.maven.plugin.testing;
-
-/* 
- * 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.IOException;
-import java.lang.reflect.Field;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DefaultArtifact;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.plugin.testing.stubs.DefaultArtifactHandlerStub;
-import org.codehaus.plexus.archiver.Archiver;
-import org.codehaus.plexus.archiver.ArchiverException;
-import org.codehaus.plexus.archiver.manager.ArchiverManager;
-import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
-import org.codehaus.plexus.archiver.war.WarArchiver;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.ReflectionUtils;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * This class creates artifacts to be used for testing purposes. It can optionally create actual files on the local disk
- * for things like copying. It can create these files as archives with named files inside to be used for testing things
- * like unpack. Also provided are some utility methods to quickly get a set of artifacts distinguished by various things
- * like group,artifact,type,scope, etc It was originally developed for the dependency plugin, but can be useful in other
- * plugins that need to simulate artifacts for unit tests.
- * 
- * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
- */
-public class ArtifactStubFactory
-{
-    File workingDir;
-
-    boolean createFiles;
-
-    File srcFile;
-
-    boolean createUnpackableFile;
-
-    ArchiverManager archiverManager;
-
-    /**
-     * Default constructor. This should be used only if real files aren't needed...just the artifact objects
-     */
-    public ArtifactStubFactory()
-    {
-        this.workingDir = null;
-        this.createFiles = false;
-    }
-
-    /**
-     * This constructor is to be used if files are needed and to set a working dir
-     * 
-     * @param workingDir
-     * @param createFiles
-     */
-    public ArtifactStubFactory( File workingDir, boolean createFiles )
-    {
-        this.workingDir = new File( workingDir, "localTestRepo" );
-        this.createFiles = createFiles;
-    }
-
-    /**
-     * If set, the file will be created as a zip/jar/war with a file inside that can be checked to exist after
-     * unpacking.
-     * 
-     * @param archiverManager
-     */
-    public void setUnpackableFile( ArchiverManager archiverManager )
-    {
-        this.createUnpackableFile = true;
-        this.archiverManager = archiverManager;
-    }
-
-    public Artifact createArtifact( String groupId, String artifactId, String version )
-        throws IOException
-    {
-        return createArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, "jar", "" );
-    }
-
-    public Artifact createArtifact( String groupId, String artifactId, String version, String scope )
-        throws IOException
-    {
-        return createArtifact( groupId, artifactId, version, scope, "jar", "" );
-    }
-
-    public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type,
-                                    String classifier )
-        throws IOException
-    {
-        VersionRange vr = VersionRange.createFromVersion( version );
-        return createArtifact( groupId, artifactId, vr, scope, type, classifier, false );
-    }
-
-    public Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String scope,
-                                    String type, String classifier, boolean optional )
-        throws IOException
-    {
-        ArtifactHandler ah = new DefaultArtifactHandlerStub( type, classifier );
-
-        Artifact artifact =
-            new DefaultArtifact( groupId, artifactId, versionRange, scope, type, classifier, ah, optional );
-
-        // i have no idea why this needs to be done manually when isSnapshot is able to figure it out.
-        artifact.setRelease( !artifact.isSnapshot() );
-
-        if ( createFiles )
-        {
-            setArtifactFile( artifact,this.workingDir,this.srcFile,this.createUnpackableFile );
-        }
-        return artifact;
-    }
-
-    /**
-     * Creates a new empty file and attaches it to the artifact.
-     * 
-     * @param artifact to attach the file to.
-     * @param workingDir where to locate the new file
-     * @throws IOException
-     */
-    public void setArtifactFile( Artifact artifact, File workingDir )
-        throws IOException
-    {
-        setArtifactFile( artifact, workingDir, null, false );
-    }
-
-    /**
-     * Copyies the srcFile to the workingDir and then attaches it to the artifact. If srcFile is null, a new empty file
-     * will be created.
-     * 
-     * @param artifact to attach
-     * @param workingDir where to copy the srcFile.
-     * @param srcFile file to be attached.
-     * @throws IOException
-     */
-    public void setArtifactFile( Artifact artifact, File workingDir, File srcFile )
-        throws IOException
-    {
-        setArtifactFile( artifact, workingDir, srcFile, false );
-    }
-
-    /**
-     * Creates an unpackable file (zip,jar etc) containing an empty file.
-     * 
-     * @param artifact to attach
-     * @param workingDir where to create the file.
-     * @throws IOException
-     */
-    public void setUnpackableArtifactFile( Artifact artifact, File workingDir )
-        throws IOException
-    {
-        setArtifactFile( artifact, workingDir, null, true );
-    }
-
-    /**
-     * Creates an unpackable file (zip,jar etc) containing the srcFile. If srcFile is null, a new empty file will be
-     * created.
-     * 
-     * @param artifact to attach
-     * @param workingDir where to create the file.
-     * @throws IOException
-     */
-    public void setUnpackableArtifactFile( Artifact artifact, File workingDir, File srcFile )
-        throws IOException
-    {
-        setArtifactFile( artifact, workingDir, srcFile, true );
-    }
-
-    /*
-     * Creates a file that can be copied or unpacked based on the passed in artifact
-     */
-    private void setArtifactFile( Artifact artifact, File workingDir, File srcFile, boolean createUnpackableFile )
-        throws IOException
-    {
-        if ( workingDir == null )
-        {
-            throw new IllegalArgumentException(
-                                                "The workingDir must be set." );
-        }
-
-        String fileName = getFormattedFileName( artifact, false );
-
-        File theFile = new File( workingDir, fileName );
-        theFile.getParentFile().mkdirs();
-
-        if ( srcFile == null )
-        {
-            theFile.createNewFile();
-        }
-        else if ( createUnpackableFile )
-        {
-            try
-            {
-                createUnpackableFile( artifact, theFile );
-            }
-            catch ( NoSuchArchiverException e )
-            {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-            catch ( ArchiverException e )
-            {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-            catch ( IOException e )
-            {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-        else
-        {
-            FileUtils.copyFile( srcFile, theFile );
-        }
-
-        artifact.setFile( theFile );
-    }
-
-    static public String getUnpackableFileName( Artifact artifact )
-    {
-        return "" + artifact.getGroupId() + "-" + artifact.getArtifactId() + "-" + artifact.getVersion() + "-" +
-            artifact.getClassifier() + "-" + artifact.getType() + ".txt";
-    }
-
-    public void createUnpackableFile( Artifact artifact, File destFile )
-        throws NoSuchArchiverException, ArchiverException, IOException
-    {
-        Archiver archiver = archiverManager.getArchiver( destFile );
-
-        archiver.setDestFile( destFile );
-        archiver.addFile( srcFile, getUnpackableFileName( artifact ) );
-
-        try
-        {
-            setVariableValueToObject( archiver, "logger", new SilentLog() );
-        }
-        catch ( IllegalAccessException e )
-        {
-            System.out.println( "Unable to override logger with silent log." );
-            e.printStackTrace();
-        }
-        if ( archiver instanceof WarArchiver )
-        {
-            WarArchiver war = (WarArchiver) archiver;
-            // the use of this is counter-intuitive:
-            // http://jira.codehaus.org/browse/PLX-286
-            war.setIgnoreWebxml( false );
-        }
-        archiver.createArchive();
-    }
-
-    public Artifact getReleaseArtifact()
-        throws IOException
-    {
-        return createArtifact( "testGroupId", "release", "1.0" );
-    }
-
-    public Artifact getSnapshotArtifact()
-        throws IOException
-    {
-        return createArtifact( "testGroupId", "snapshot", "2.0-SNAPSHOT" );
-    }
-
-    public Set getReleaseAndSnapshotArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( getReleaseArtifact() );
-        set.add( getSnapshotArtifact() );
-        return set;
-    }
-
-    public Set getScopedArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "g", "compile", "1.0", Artifact.SCOPE_COMPILE ) );
-        set.add( createArtifact( "g", "provided", "1.0", Artifact.SCOPE_PROVIDED ) );
-        set.add( createArtifact( "g", "test", "1.0", Artifact.SCOPE_TEST ) );
-        set.add( createArtifact( "g", "runtime", "1.0", Artifact.SCOPE_RUNTIME ) );
-        set.add( createArtifact( "g", "system", "1.0", Artifact.SCOPE_SYSTEM ) );
-        return set;
-    }
-
-    public Set getTypedArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "war", null ) );
-        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", null ) );
-        set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "sources", null ) );
-        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "zip", null ) );
-        set.add( createArtifact( "g", "e", "1.0", Artifact.SCOPE_COMPILE, "rar", null ) );
-        return set;
-    }
-
-    public Set getClassifiedArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one" ) );
-        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", "two" ) );
-        set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "jar", "three" ) );
-        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "jar", "four" ) );
-        return set;
-    }
-
-    public Set getTypedArchiveArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "war", null ) );
-        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", null ) );
-        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "zip", null ) );
-        set.add( createArtifact( "g", "e", "1.0", Artifact.SCOPE_COMPILE, "rar", null ) );
-        return set;
-    }
-
-    public Set getArtifactArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "g", "one", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "g", "two", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "g", "three", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "g", "four", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        return set;
-    }
-
-    public Set getGroupIdArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.add( createArtifact( "one", "group-one", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "two", "group-two", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "three", "group-three", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        set.add( createArtifact( "four", "group-four", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
-        return set;
-    }
-
-    public Set getMixedArtifacts()
-        throws IOException
-    {
-        Set set = new HashSet();
-        set.addAll( getTypedArtifacts() );
-        set.addAll( getScopedArtifacts() );
-        set.addAll( getReleaseAndSnapshotArtifacts() );
-        return set;
-    }
-
-    /**
-     * @return Returns the createFiles.
-     */
-    public boolean isCreateFiles()
-    {
-        return this.createFiles;
-    }
-
-    /**
-     * @param createFiles The createFiles to set.
-     */
-    public void setCreateFiles( boolean createFiles )
-    {
-        this.createFiles = createFiles;
-    }
-
-    /**
-     * @return Returns the workingDir.
-     */
-    public File getWorkingDir()
-    {
-        return this.workingDir;
-    }
-
-    /**
-     * @param workingDir The workingDir to set.
-     */
-    public void setWorkingDir( File workingDir )
-    {
-        this.workingDir = workingDir;
-    }
-
-    /**
-     * @return Returns the srcFile.
-     */
-    public File getSrcFile()
-    {
-        return this.srcFile;
-    }
-
-    /**
-     * @param srcFile The srcFile to set.
-     */
-    public void setSrcFile( File srcFile )
-    {
-        this.srcFile = srcFile;
-    }
-
-    /**
-     * convience method to set values to variables in objects that don't have setters
-     * 
-     * @param object
-     * @param variable
-     * @param value
-     * @throws IllegalAccessException
-     */
-    public static void setVariableValueToObject( Object object, String variable, Object value )
-        throws IllegalAccessException
-    {
-        Field field = ReflectionUtils.getFieldByNameIncludingSuperclasses( variable, object.getClass() );
-
-        field.setAccessible( true );
-
-        field.set( object, value );
-    }
-
-    /**
-     * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the artifactId,
-     * Classifier (if used) and Type. Otherwise, this method returns the artifact file name.
-     * 
-     * @param artifact File to be formatted.
-     * @param removeVersion Specifies if the version should be removed from the file name.
-     * @return Formatted file name in the format artifactId-[version]-[classifier].[type]
-     */
-    public static String getFormattedFileName( Artifact artifact, boolean removeVersion )
-    {
-        String destFileName = null;
-
-        // if there is a file and we aren't stripping the version, just get the
-        // name directly
-        if ( artifact.getFile() != null && !removeVersion )
-        {
-            destFileName = artifact.getFile().getName();
-        }
-        else
-        // if offline
-        {
-            String versionString = null;
-            if ( !removeVersion )
-            {
-                versionString = "-" + artifact.getVersion();
-            }
-            else
-            {
-                versionString = "";
-            }
-
-            String classifierString = "";
-
-            if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
-            {
-                classifierString = "-" + artifact.getClassifier();
-            }
-
-            destFileName =
-                artifact.getArtifactId() + versionString + classifierString + "." +
-                    artifact.getArtifactHandler().getExtension();
-        }
-        return destFileName;
-    }
-
-}
+package org.apache.maven.plugin.testing;
+
+/* 
+ * 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.IOException;
+import java.lang.reflect.Field;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.testing.stubs.DefaultArtifactHandlerStub;
+import org.codehaus.plexus.archiver.Archiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
+import org.codehaus.plexus.archiver.war.WarArchiver;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.ReflectionUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * This class creates artifacts to be used for testing purposes. It can optionally create actual files on the local disk
+ * for things like copying. It can create these files as archives with named files inside to be used for testing things
+ * like unpack. Also provided are some utility methods to quickly get a set of artifacts distinguished by various things
+ * like group,artifact,type,scope, etc It was originally developed for the dependency plugin, but can be useful in other
+ * plugins that need to simulate artifacts for unit tests.
+ * 
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ */
+public class ArtifactStubFactory
+{
+    File workingDir;
+
+    boolean createFiles;
+
+    File srcFile;
+
+    boolean createUnpackableFile;
+
+    ArchiverManager archiverManager;
+
+    /**
+     * Default constructor. This should be used only if real files aren't needed...just the artifact objects
+     */
+    public ArtifactStubFactory()
+    {
+        this.workingDir = null;
+        this.createFiles = false;
+    }
+
+    /**
+     * This constructor is to be used if files are needed and to set a working dir
+     * 
+     * @param workingDir
+     * @param createFiles
+     */
+    public ArtifactStubFactory( File workingDir, boolean createFiles )
+    {
+        this.workingDir = new File( workingDir, "localTestRepo" );
+        this.createFiles = createFiles;
+    }
+
+    /**
+     * If set, the file will be created as a zip/jar/war with a file inside that can be checked to exist after
+     * unpacking.
+     * 
+     * @param archiverManager
+     */
+    public void setUnpackableFile( ArchiverManager archiverManager )
+    {
+        this.createUnpackableFile = true;
+        this.archiverManager = archiverManager;
+    }
+
+    public Artifact createArtifact( String groupId, String artifactId, String version )
+        throws IOException
+    {
+        return createArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, "jar", "" );
+    }
+
+    public Artifact createArtifact( String groupId, String artifactId, String version, String scope )
+        throws IOException
+    {
+        return createArtifact( groupId, artifactId, version, scope, "jar", "" );
+    }
+
+    public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type,
+                                    String classifier )
+        throws IOException
+    {
+        VersionRange vr = VersionRange.createFromVersion( version );
+        return createArtifact( groupId, artifactId, vr, scope, type, classifier, false );
+    }
+
+    public Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String scope,
+                                    String type, String classifier, boolean optional )
+        throws IOException
+    {
+        ArtifactHandler ah = new DefaultArtifactHandlerStub( type, classifier );
+
+        Artifact artifact =
+            new DefaultArtifact( groupId, artifactId, versionRange, scope, type, classifier, ah, optional );
+
+        // i have no idea why this needs to be done manually when isSnapshot is able to figure it out.
+        artifact.setRelease( !artifact.isSnapshot() );
+
+        if ( createFiles )
+        {
+            setArtifactFile( artifact,this.workingDir,this.srcFile,this.createUnpackableFile );
+        }
+        return artifact;
+    }
+
+    /**
+     * Creates a new empty file and attaches it to the artifact.
+     * 
+     * @param artifact to attach the file to.
+     * @param workingDir where to locate the new file
+     * @throws IOException
+     */
+    public void setArtifactFile( Artifact artifact, File workingDir )
+        throws IOException
+    {
+        setArtifactFile( artifact, workingDir, null, false );
+    }
+
+    /**
+     * Copyies the srcFile to the workingDir and then attaches it to the artifact. If srcFile is null, a new empty file
+     * will be created.
+     * 
+     * @param artifact to attach
+     * @param workingDir where to copy the srcFile.
+     * @param srcFile file to be attached.
+     * @throws IOException
+     */
+    public void setArtifactFile( Artifact artifact, File workingDir, File srcFile )
+        throws IOException
+    {
+        setArtifactFile( artifact, workingDir, srcFile, false );
+    }
+
+    /**
+     * Creates an unpackable file (zip,jar etc) containing an empty file.
+     * 
+     * @param artifact to attach
+     * @param workingDir where to create the file.
+     * @throws IOException
+     */
+    public void setUnpackableArtifactFile( Artifact artifact, File workingDir )
+        throws IOException
+    {
+        setArtifactFile( artifact, workingDir, null, true );
+    }
+
+    /**
+     * Creates an unpackable file (zip,jar etc) containing the srcFile. If srcFile is null, a new empty file will be
+     * created.
+     * 
+     * @param artifact to attach
+     * @param workingDir where to create the file.
+     * @throws IOException
+     */
+    public void setUnpackableArtifactFile( Artifact artifact, File workingDir, File srcFile )
+        throws IOException
+    {
+        setArtifactFile( artifact, workingDir, srcFile, true );
+    }
+
+    /*
+     * Creates a file that can be copied or unpacked based on the passed in artifact
+     */
+    private void setArtifactFile( Artifact artifact, File workingDir, File srcFile, boolean createUnpackableFile )
+        throws IOException
+    {
+        if ( workingDir == null )
+        {
+            throw new IllegalArgumentException(
+                                                "The workingDir must be set." );
+        }
+
+        String fileName = getFormattedFileName( artifact, false );
+
+        File theFile = new File( workingDir, fileName );
+        theFile.getParentFile().mkdirs();
+
+        if ( srcFile == null )
+        {
+            theFile.createNewFile();
+        }
+        else if ( createUnpackableFile )
+        {
+            try
+            {
+                createUnpackableFile( artifact, theFile );
+            }
+            catch ( NoSuchArchiverException e )
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+            catch ( ArchiverException e )
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+            catch ( IOException e )
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+        else
+        {
+            FileUtils.copyFile( srcFile, theFile );
+        }
+
+        artifact.setFile( theFile );
+    }
+
+    static public String getUnpackableFileName( Artifact artifact )
+    {
+        return "" + artifact.getGroupId() + "-" + artifact.getArtifactId() + "-" + artifact.getVersion() + "-" +
+            artifact.getClassifier() + "-" + artifact.getType() + ".txt";
+    }
+
+    public void createUnpackableFile( Artifact artifact, File destFile )
+        throws NoSuchArchiverException, ArchiverException, IOException
+    {
+        Archiver archiver = archiverManager.getArchiver( destFile );
+
+        archiver.setDestFile( destFile );
+        archiver.addFile( srcFile, getUnpackableFileName( artifact ) );
+
+        try
+        {
+            setVariableValueToObject( archiver, "logger", new SilentLog() );
+        }
+        catch ( IllegalAccessException e )
+        {
+            System.out.println( "Unable to override logger with silent log." );
+            e.printStackTrace();
+        }
+        if ( archiver instanceof WarArchiver )
+        {
+            WarArchiver war = (WarArchiver) archiver;
+            // the use of this is counter-intuitive:
+            // http://jira.codehaus.org/browse/PLX-286
+            war.setIgnoreWebxml( false );
+        }
+        archiver.createArchive();
+    }
+
+    public Artifact getReleaseArtifact()
+        throws IOException
+    {
+        return createArtifact( "testGroupId", "release", "1.0" );
+    }
+
+    public Artifact getSnapshotArtifact()
+        throws IOException
+    {
+        return createArtifact( "testGroupId", "snapshot", "2.0-SNAPSHOT" );
+    }
+
+    public Set getReleaseAndSnapshotArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( getReleaseArtifact() );
+        set.add( getSnapshotArtifact() );
+        return set;
+    }
+
+    public Set getScopedArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "g", "compile", "1.0", Artifact.SCOPE_COMPILE ) );
+        set.add( createArtifact( "g", "provided", "1.0", Artifact.SCOPE_PROVIDED ) );
+        set.add( createArtifact( "g", "test", "1.0", Artifact.SCOPE_TEST ) );
+        set.add( createArtifact( "g", "runtime", "1.0", Artifact.SCOPE_RUNTIME ) );
+        set.add( createArtifact( "g", "system", "1.0", Artifact.SCOPE_SYSTEM ) );
+        return set;
+    }
+
+    public Set getTypedArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "war", null ) );
+        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", null ) );
+        set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "sources", null ) );
+        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "zip", null ) );
+        set.add( createArtifact( "g", "e", "1.0", Artifact.SCOPE_COMPILE, "rar", null ) );
+        return set;
+    }
+
+    public Set getClassifiedArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one" ) );
+        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", "two" ) );
+        set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "jar", "three" ) );
+        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "jar", "four" ) );
+        return set;
+    }
+
+    public Set getTypedArchiveArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "war", null ) );
+        set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", null ) );
+        set.add( createArtifact( "g", "d", "1.0", Artifact.SCOPE_COMPILE, "zip", null ) );
+        set.add( createArtifact( "g", "e", "1.0", Artifact.SCOPE_COMPILE, "rar", null ) );
+        return set;
+    }
+
+    public Set getArtifactArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "g", "one", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "g", "two", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "g", "three", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "g", "four", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        return set;
+    }
+
+    public Set getGroupIdArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.add( createArtifact( "one", "group-one", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "two", "group-two", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "three", "group-three", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        set.add( createArtifact( "four", "group-four", "1.0", Artifact.SCOPE_COMPILE, "jar", "a" ) );
+        return set;
+    }
+
+    public Set getMixedArtifacts()
+        throws IOException
+    {
+        Set set = new HashSet();
+        set.addAll( getTypedArtifacts() );
+        set.addAll( getScopedArtifacts() );
+        set.addAll( getReleaseAndSnapshotArtifacts() );
+        return set;
+    }
+
+    /**
+     * @return Returns the createFiles.
+     */
+    public boolean isCreateFiles()
+    {
+        return this.createFiles;
+    }
+
+    /**
+     * @param createFiles The createFiles to set.
+     */
+    public void setCreateFiles( boolean createFiles )
+    {
+        this.createFiles = createFiles;
+    }
+
+    /**
+     * @return Returns the workingDir.
+     */
+    public File getWorkingDir()
+    {
+        return this.workingDir;
+    }
+
+    /**
+     * @param workingDir The workingDir to set.
+     */
+    public void setWorkingDir( File workingDir )
+    {
+        this.workingDir = workingDir;
+    }
+
+    /**
+     * @return Returns the srcFile.
+     */
+    public File getSrcFile()
+    {
+        return this.srcFile;
+    }
+
+    /**
+     * @param srcFile The srcFile to set.
+     */
+    public void setSrcFile( File srcFile )
+    {
+        this.srcFile = srcFile;
+    }
+
+    /**
+     * convience method to set values to variables in objects that don't have setters
+     * 
+     * @param object
+     * @param variable
+     * @param value
+     * @throws IllegalAccessException
+     */
+    public static void setVariableValueToObject( Object object, String variable, Object value )
+        throws IllegalAccessException
+    {
+        Field field = ReflectionUtils.getFieldByNameIncludingSuperclasses( variable, object.getClass() );
+
+        field.setAccessible( true );
+
+        field.set( object, value );
+    }
+
+    /**
+     * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the artifactId,
+     * Classifier (if used) and Type. Otherwise, this method returns the artifact file name.
+     * 
+     * @param artifact File to be formatted.
+     * @param removeVersion Specifies if the version should be removed from the file name.
+     * @return Formatted file name in the format artifactId-[version]-[classifier].[type]
+     */
+    public static String getFormattedFileName( Artifact artifact, boolean removeVersion )
+    {
+        String destFileName = null;
+
+        // if there is a file and we aren't stripping the version, just get the
+        // name directly
+        if ( artifact.getFile() != null && !removeVersion )
+        {
+            destFileName = artifact.getFile().getName();
+        }
+        else
+        // if offline
+        {
+            String versionString = null;
+            if ( !removeVersion )
+            {
+                versionString = "-" + artifact.getVersion();
+            }
+            else
+            {
+                versionString = "";
+            }
+
+            String classifierString = "";
+
+            if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
+            {
+                classifierString = "-" + artifact.getClassifier();
+            }
+
+            destFileName =
+                artifact.getArtifactId() + versionString + classifierString + "." +
+                    artifact.getArtifactHandler().getExtension();
+        }
+        return destFileName;
+    }
+
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java?rev=628492&r1=628491&r2=628492&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java Sun Feb 17 07:12:38 2008
@@ -1,328 +1,328 @@
-package org.apache.maven.plugin.testing;
-
-/*
- * 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.plugin.logging.Log;
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * This logger implements both types of logs currently in use. It can be injected where needed
- * to turn off logs during testing where they aren't desired.
- *
- * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
- * @version $Id: SilentLog.java 546355 2007-06-12 02:00:02Z brianf $
- */
-public class SilentLog
-    implements Log, Logger
-{
-    /**
-     * @return <code>false</code>
-     * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
-     */
-    public boolean isDebugEnabled()
-    {
-        return false;
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence)
-     */
-    public void debug( CharSequence content )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void debug( CharSequence content, Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.Throwable)
-     */
-    public void debug( Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * @return <code>false</code>
-     * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
-     */
-    public boolean isInfoEnabled()
-    {
-        return false;
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence)
-     */
-    public void info( CharSequence content )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void info( CharSequence content, Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.Throwable)
-     */
-    public void info( Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
-     */
-    public boolean isWarnEnabled()
-    {
-        // nop
-        return false;
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence)
-     */
-    public void warn( CharSequence content )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void warn( CharSequence content, Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.Throwable)
-     */
-    public void warn( Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * @return <code>false</code>
-     * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
-     */
-    public boolean isErrorEnabled()
-    {
-        return false;
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence)
-     */
-    public void error( CharSequence content )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void error( CharSequence content, Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
-     */
-    public void error( Throwable error )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String)
-     */
-    public void debug( String message )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String, java.lang.Throwable)
-     */
-    public void debug( String message, Throwable throwable )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#info(java.lang.String)
-     */
-    public void info( String message )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#info(java.lang.String, java.lang.Throwable)
-     */
-    public void info( String message, Throwable throwable )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String)
-     */
-    public void warn( String message )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String, java.lang.Throwable)
-     */
-    public void warn( String message, Throwable throwable )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#error(java.lang.String)
-     */
-    public void error( String message )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#error(java.lang.String, java.lang.Throwable)
-     */
-    public void error( String message, Throwable throwable )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String)
-     */
-    public void fatalError( String message )
-    {
-        // nop
-    }
-
-    /**
-     * By default, do nothing.
-     *
-     * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String, java.lang.Throwable)
-     */
-    public void fatalError( String message, Throwable throwable )
-    {
-        // nop
-    }
-
-    /**
-     * @return <code>false</code>
-     * @see org.codehaus.plexus.logging.Logger#isFatalErrorEnabled()
-     */
-    public boolean isFatalErrorEnabled()
-    {
-        return false;
-    }
-
-    /**
-     * @return <code>null</code>
-     * @see org.codehaus.plexus.logging.Logger#getChildLogger(java.lang.String)
-     */
-    public Logger getChildLogger( String name )
-    {
-        return null;
-    }
-
-    /**
-     * @return <code>0</code>
-     * @see org.codehaus.plexus.logging.Logger#getThreshold()
-     */
-    public int getThreshold()
-    {
-        return 0;
-    }
-
-    /**
-     * @return <code>null</code>
-     * @see org.codehaus.plexus.logging.Logger#getName()
-     */
-    public String getName()
-    {
-        return null;
-    }
-}
+package org.apache.maven.plugin.testing;
+
+/*
+ * 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.plugin.logging.Log;
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * This logger implements both types of logs currently in use. It can be injected where needed
+ * to turn off logs during testing where they aren't desired.
+ *
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @version $Id$
+ */
+public class SilentLog
+    implements Log, Logger
+{
+    /**
+     * @return <code>false</code>
+     * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
+     */
+    public boolean isDebugEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence)
+     */
+    public void debug( CharSequence content )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence, java.lang.Throwable)
+     */
+    public void debug( CharSequence content, Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.Throwable)
+     */
+    public void debug( Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * @return <code>false</code>
+     * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
+     */
+    public boolean isInfoEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence)
+     */
+    public void info( CharSequence content )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence, java.lang.Throwable)
+     */
+    public void info( CharSequence content, Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#info(java.lang.Throwable)
+     */
+    public void info( Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
+     */
+    public boolean isWarnEnabled()
+    {
+        // nop
+        return false;
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence)
+     */
+    public void warn( CharSequence content )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence, java.lang.Throwable)
+     */
+    public void warn( CharSequence content, Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.Throwable)
+     */
+    public void warn( Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * @return <code>false</code>
+     * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
+     */
+    public boolean isErrorEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence)
+     */
+    public void error( CharSequence content )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence, java.lang.Throwable)
+     */
+    public void error( CharSequence content, Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
+     */
+    public void error( Throwable error )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String)
+     */
+    public void debug( String message )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String, java.lang.Throwable)
+     */
+    public void debug( String message, Throwable throwable )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#info(java.lang.String)
+     */
+    public void info( String message )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#info(java.lang.String, java.lang.Throwable)
+     */
+    public void info( String message, Throwable throwable )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String)
+     */
+    public void warn( String message )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String, java.lang.Throwable)
+     */
+    public void warn( String message, Throwable throwable )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#error(java.lang.String)
+     */
+    public void error( String message )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#error(java.lang.String, java.lang.Throwable)
+     */
+    public void error( String message, Throwable throwable )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String)
+     */
+    public void fatalError( String message )
+    {
+        // nop
+    }
+
+    /**
+     * By default, do nothing.
+     *
+     * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String, java.lang.Throwable)
+     */
+    public void fatalError( String message, Throwable throwable )
+    {
+        // nop
+    }
+
+    /**
+     * @return <code>false</code>
+     * @see org.codehaus.plexus.logging.Logger#isFatalErrorEnabled()
+     */
+    public boolean isFatalErrorEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * @return <code>null</code>
+     * @see org.codehaus.plexus.logging.Logger#getChildLogger(java.lang.String)
+     */
+    public Logger getChildLogger( String name )
+    {
+        return null;
+    }
+
+    /**
+     * @return <code>0</code>
+     * @see org.codehaus.plexus.logging.Logger#getThreshold()
+     */
+    public int getThreshold()
+    {
+        return 0;
+    }
+
+    /**
+     * @return <code>null</code>
+     * @see org.codehaus.plexus.logging.Logger#getName()
+     */
+    public String getName()
+    {
+        return null;
+    }
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java?rev=628492&r1=628491&r2=628492&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java Sun Feb 17 07:12:38 2008
@@ -1,210 +1,210 @@
-package org.apache.maven.plugin.testing.stubs;
-
-/*
- * 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.artifact.handler.ArtifactHandler;
-
-/**
- * Minimal artifact handler used by the stub factory to create unpackable archives.
- *
- * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
- * @version $Id: $
- */
-public class DefaultArtifactHandlerStub
-    implements ArtifactHandler
-{
-    private String extension;
-
-    private String type;
-
-    private String classifier;
-
-    private String directory;
-
-    private String packaging;
-
-    private boolean includesDependencies;
-
-    private String language;
-
-    private boolean addedToClasspath;
-
-    /**
-     * @param t the artifact handler type
-     * @param c the artifact handler classifier
-     */
-    public DefaultArtifactHandlerStub( String t, String c )
-    {
-        type = t;
-        classifier = c;
-        if ( t.equals( "test-jar" ) )
-        {
-            extension = "jar";
-        }
-
-    }
-
-    /**
-     * @param t the artifact handler type
-     */
-    public DefaultArtifactHandlerStub( String type )
-    {
-        this.type = type;
-    }
-
-    /** {@inheritDoc} */
-    public String getExtension()
-    {
-        if ( extension == null )
-        {
-            extension = type;
-        }
-        return extension;
-    }
-
-    /**
-     * @return the artifact handler type
-     */
-    public String getType()
-    {
-        return type;
-    }
-
-    /** {@inheritDoc} */
-    public String getClassifier()
-    {
-        return classifier;
-    }
-
-    /** {@inheritDoc} */
-    public String getDirectory()
-    {
-        if ( directory == null )
-        {
-            directory = getPackaging() + "s";
-        }
-        return directory;
-    }
-
-    /** {@inheritDoc} */
-    public String getPackaging()
-    {
-        if ( packaging == null )
-        {
-            packaging = type;
-        }
-        return packaging;
-    }
-
-    /** {@inheritDoc} */
-    public boolean isIncludesDependencies()
-    {
-        return includesDependencies;
-    }
-
-    /** {@inheritDoc} */
-    public String getLanguage()
-    {
-        if ( language == null )
-        {
-            language = "none";
-        }
-
-        return language;
-    }
-
-    /** {@inheritDoc} */
-    public boolean isAddedToClasspath()
-    {
-        return addedToClasspath;
-    }
-
-    /**
-     * @param theAddedToClasspath
-     *            The addedToClasspath to set.
-     */
-    public void setAddedToClasspath( boolean theAddedToClasspath )
-    {
-        this.addedToClasspath = theAddedToClasspath;
-    }
-
-    /**
-     * @param theClassifier
-     *            The classifier to set.
-     */
-    public void setClassifier( String theClassifier )
-    {
-        this.classifier = theClassifier;
-    }
-
-    /**
-     * @param theDirectory
-     *            The directory to set.
-     */
-    public void setDirectory( String theDirectory )
-    {
-        this.directory = theDirectory;
-    }
-
-    /**
-     * @param theExtension
-     *            The extension to set.
-     */
-    public void setExtension( String theExtension )
-    {
-        this.extension = theExtension;
-    }
-
-    /**
-     * @param theIncludesDependencies
-     *            The includesDependencies to set.
-     */
-    public void setIncludesDependencies( boolean theIncludesDependencies )
-    {
-        this.includesDependencies = theIncludesDependencies;
-    }
-
-    /**
-     * @param theLanguage
-     *            The language to set.
-     */
-    public void setLanguage( String theLanguage )
-    {
-        this.language = theLanguage;
-    }
-
-    /**
-     * @param thePackaging
-     *            The packaging to set.
-     */
-    public void setPackaging( String thePackaging )
-    {
-        this.packaging = thePackaging;
-    }
-
-    /**
-     * @param theType
-     *            The type to set.
-     */
-    public void setType( String theType )
-    {
-        this.type = theType;
-    }
-}
+package org.apache.maven.plugin.testing.stubs;
+
+/*
+ * 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.artifact.handler.ArtifactHandler;
+
+/**
+ * Minimal artifact handler used by the stub factory to create unpackable archives.
+ *
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @version $Id$
+ */
+public class DefaultArtifactHandlerStub
+    implements ArtifactHandler
+{
+    private String extension;
+
+    private String type;
+
+    private String classifier;
+
+    private String directory;
+
+    private String packaging;
+
+    private boolean includesDependencies;
+
+    private String language;
+
+    private boolean addedToClasspath;
+
+    /**
+     * @param t the artifact handler type
+     * @param c the artifact handler classifier
+     */
+    public DefaultArtifactHandlerStub( String t, String c )
+    {
+        type = t;
+        classifier = c;
+        if ( t.equals( "test-jar" ) )
+        {
+            extension = "jar";
+        }
+
+    }
+
+    /**
+     * @param t the artifact handler type
+     */
+    public DefaultArtifactHandlerStub( String type )
+    {
+        this.type = type;
+    }
+
+    /** {@inheritDoc} */
+    public String getExtension()
+    {
+        if ( extension == null )
+        {
+            extension = type;
+        }
+        return extension;
+    }
+
+    /**
+     * @return the artifact handler type
+     */
+    public String getType()
+    {
+        return type;
+    }
+
+    /** {@inheritDoc} */
+    public String getClassifier()
+    {
+        return classifier;
+    }
+
+    /** {@inheritDoc} */
+    public String getDirectory()
+    {
+        if ( directory == null )
+        {
+            directory = getPackaging() + "s";
+        }
+        return directory;
+    }
+
+    /** {@inheritDoc} */
+    public String getPackaging()
+    {
+        if ( packaging == null )
+        {
+            packaging = type;
+        }
+        return packaging;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isIncludesDependencies()
+    {
+        return includesDependencies;
+    }
+
+    /** {@inheritDoc} */
+    public String getLanguage()
+    {
+        if ( language == null )
+        {
+            language = "none";
+        }
+
+        return language;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isAddedToClasspath()
+    {
+        return addedToClasspath;
+    }
+
+    /**
+     * @param theAddedToClasspath
+     *            The addedToClasspath to set.
+     */
+    public void setAddedToClasspath( boolean theAddedToClasspath )
+    {
+        this.addedToClasspath = theAddedToClasspath;
+    }
+
+    /**
+     * @param theClassifier
+     *            The classifier to set.
+     */
+    public void setClassifier( String theClassifier )
+    {
+        this.classifier = theClassifier;
+    }
+
+    /**
+     * @param theDirectory
+     *            The directory to set.
+     */
+    public void setDirectory( String theDirectory )
+    {
+        this.directory = theDirectory;
+    }
+
+    /**
+     * @param theExtension
+     *            The extension to set.
+     */
+    public void setExtension( String theExtension )
+    {
+        this.extension = theExtension;
+    }
+
+    /**
+     * @param theIncludesDependencies
+     *            The includesDependencies to set.
+     */
+    public void setIncludesDependencies( boolean theIncludesDependencies )
+    {
+        this.includesDependencies = theIncludesDependencies;
+    }
+
+    /**
+     * @param theLanguage
+     *            The language to set.
+     */
+    public void setLanguage( String theLanguage )
+    {
+        this.language = theLanguage;
+    }
+
+    /**
+     * @param thePackaging
+     *            The packaging to set.
+     */
+    public void setPackaging( String thePackaging )
+    {
+        this.packaging = thePackaging;
+    }
+
+    /**
+     * @param theType
+     *            The type to set.
+     */
+    public void setType( String theType )
+    {
+        this.type = theType;
+    }
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java?rev=628492&r1=628491&r2=628492&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java Sun Feb 17 07:12:38 2008
@@ -1,89 +1,89 @@
-package org.apache.maven.plugin.testing.stubs;
-
-/*
- * 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.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ResolutionNode;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-
-/**
- * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
- * @version $Id: $
- */
-public class StubArtifactCollector
-    implements ArtifactCollector
-{
-    /**
-     * Default constructor
-     */
-    public StubArtifactCollector()
-    {
-        super();
-    }
-
-    /** {@inheritDoc} */
-    public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact,
-                                            ArtifactRepository theLocalRepository, List theRemoteRepositories,
-                                            ArtifactMetadataSource theSource, ArtifactFilter theFilter,
-                                            List theListeners )
-        throws ArtifactResolutionException
-    {
-        Set nodes = new HashSet();
-        ArtifactResolutionResult arr = new ArtifactResolutionResult();
-
-        Iterator iter = theArtifacts.iterator();
-        while ( iter.hasNext() )
-        {
-            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
-        }
-        arr.setArtifactResolutionNodes( nodes );
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact, Map theManagedVersions,
-                                            ArtifactRepository theLocalRepository, List theRemoteRepositories,
-                                            ArtifactMetadataSource theSource, ArtifactFilter theFilter,
-                                            List theListeners )
-        throws ArtifactResolutionException
-    {
-        Set nodes = new HashSet();
-        ArtifactResolutionResult arr = new ArtifactResolutionResult();
-
-        Iterator iter = theArtifacts.iterator();
-        while ( iter.hasNext() )
-        {
-            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
-        }
-        arr.setArtifactResolutionNodes( nodes );
-        return arr;
-    }
-}
+package org.apache.maven.plugin.testing.stubs;
+
+/*
+ * 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.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.artifact.resolver.ResolutionNode;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+
+/**
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @version $Id$
+ */
+public class StubArtifactCollector
+    implements ArtifactCollector
+{
+    /**
+     * Default constructor
+     */
+    public StubArtifactCollector()
+    {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact,
+                                            ArtifactRepository theLocalRepository, List theRemoteRepositories,
+                                            ArtifactMetadataSource theSource, ArtifactFilter theFilter,
+                                            List theListeners )
+        throws ArtifactResolutionException
+    {
+        Set nodes = new HashSet();
+        ArtifactResolutionResult arr = new ArtifactResolutionResult();
+
+        Iterator iter = theArtifacts.iterator();
+        while ( iter.hasNext() )
+        {
+            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
+        }
+        arr.setArtifactResolutionNodes( nodes );
+        return arr;
+    }
+
+    /** {@inheritDoc} */
+    public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact, Map theManagedVersions,
+                                            ArtifactRepository theLocalRepository, List theRemoteRepositories,
+                                            ArtifactMetadataSource theSource, ArtifactFilter theFilter,
+                                            List theListeners )
+        throws ArtifactResolutionException
+    {
+        Set nodes = new HashSet();
+        ArtifactResolutionResult arr = new ArtifactResolutionResult();
+
+        Iterator iter = theArtifacts.iterator();
+        while ( iter.hasNext() )
+        {
+            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
+        }
+        arr.setArtifactResolutionNodes( nodes );
+        return arr;
+    }
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"