From 1b81facb3a15592bbdb3abb29d13173cb5fe83c5 Mon Sep 17 00:00:00 2001
From: Vincent Siveton
- A unit test attempts to verify a mojo as an isolated unit, by mocking out the rest of the Maven environment.
- A mojo unit test does not attempt to run your plugin in the context of a real Maven build.
- Unit tests are designed to be fast.
-
- This testing library is NOT designed for integration or functional testing.
-
- DefaultArtifact instance for the given parameters
- * @throws IOException if any
- * @see #createArtifact(String, String, String, String, String, String)
- */
- public Artifact createArtifact( String groupId, String artifactId, String version )
- throws IOException
- {
- return createArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, "jar", "" );
- }
-
- /**
- * @param groupId
- * @param artifactId
- * @param version
- * @param scope
- * @return a DefaultArtifact instance for the given parameters
- * @throws IOException if any
- * @see #createArtifact(String, String, String, String, String, String)
- */
- public Artifact createArtifact( String groupId, String artifactId, String version, String scope )
- throws IOException
- {
- return createArtifact( groupId, artifactId, version, scope, "jar", "" );
- }
-
- /**
- * @param groupId
- * @param artifactId
- * @param version
- * @param scope
- * @param type
- * @param classifier
- * @return a DefaultArtifact instance for the given parameters
- * @throws IOException if any
- * @see #createArtifact(String, String, VersionRange, String, String, String, boolean)
- */
- 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 );
- }
-
- /**
- * @param groupId not null
- * @param artifactId not null
- * @param versionRange not null
- * @param scope not null
- * @param type not null
- * @param classifier
- * @param optional not null
- * @return a DefaultArtifact instance
- * @throws IOException if any
- */
- 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.
- * @param srcFile
- * @throws IOException if any
- */
- 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
- *
- * @param artifact
- * @param workingDir
- * @param srcFile
- * @param createUnpackableFile
- * @throws IOException if any
- */
- 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 )
- {
- throw new IOException( "NoSuchArchiverException: " + e.getMessage() );
- }
- catch ( ArchiverException e )
- {
- throw new IOException( "ArchiverException: " + e.getMessage() );
- }
- }
- else
- {
- FileUtils.copyFile( srcFile, theFile );
- }
-
- artifact.setFile( theFile );
- }
-
- /**
- * @param artifact
- * @return
- */
- public static String getUnpackableFileName( Artifact artifact )
- {
- return "" + artifact.getGroupId() + "-" + artifact.getArtifactId() + "-" + artifact.getVersion() + "-"
- + artifact.getClassifier() + "-" + artifact.getType() + ".txt";
- }
-
- /**
- * @param artifact
- * @param destFile
- * @throws NoSuchArchiverException
- * @throws ArchiverException if any
- * @throws IOException if any
- */
- 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();
- }
-
- /**
- * @return a DefaultArtifact instance for testGroupId:release:jar:1.0
- * @throws IOException if any
- */
- public Artifact getReleaseArtifact()
- throws IOException
- {
- return createArtifact( "testGroupId", "release", "1.0" );
- }
-
- /**
- * @return a default DefaultArtifact instance for testGroupId:snapshot:jar:2.0-SNAPSHOT
- * @throws IOException if any
- */
- public Artifact getSnapshotArtifact()
- throws IOException
- {
- return createArtifact( "testGroupId", "snapshot", "2.0-SNAPSHOT" );
- }
-
- /**
- * @return a default set of release and snapshot DefaultArtifact, i.e.:
- * testGroupId:snapshot:jar:2.0-SNAPSHOT, testGroupId:release:jar:1.0
- * @throws IOException if any
- * @see #getReleaseArtifact()
- * @see #getSnapshotArtifact()
- */
- public Set getReleaseAndSnapshotArtifacts()
- throws IOException
- {
- Set set = new HashSet();
- set.add( getReleaseArtifact() );
- set.add( getSnapshotArtifact() );
- return set;
- }
-
- /**
- * @return a default set of DefaultArtifact, i.e.:
- * g:provided:jar:1.0, g:compile:jar:1.0, g:system:jar:1.0, g:test:jar:1.0, g:runtime:jar:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact, i.e.:
- * g:d:zip:1.0, g:a:war:1.0, g:b:jar:1.0, g:c:sources:1.0, g:e:rar:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact, i.e.:
- * g:c:jar:three:1.0, g:b:jar:two:1.0, g:d:jar:four:1.0, g:a:jar:one:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact, i.e.:
- * g:d:zip:1.0, g:a:war:1.0, g:b:jar:1.0, g:e:rar:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact, i.e.:
- * g:one:jar:a:1.0, g:two:jar:a:1.0, g:four:jar:a:1.0, g:three:jar:a:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact, i.e.:
- * one:group-one:jar:a:1.0, three:group-three:jar:a:1.0, four:group-four:jar:a:1.0,
- * two:group-two:jar:a:1.0
- * @throws IOException if any
- */
- 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;
- }
-
- /**
- * @return a set of DefaultArtifact
- * @throws IOException if any
- * @see #getTypedArtifacts()
- * @see #getScopedArtifacts()
- * @see #getReleaseAndSnapshotArtifacts()
- */
- 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;
- }
-
- /**
- * Convenience 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;
- }
-
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ConfigurationException.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ConfigurationException.java
deleted file mode 100644
index 3b85c8f..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ConfigurationException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-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.
- */
-
-/**
- * ConfigurationException
- *
- * @author jesse
- * @version $Id$
- */
-public class ConfigurationException
- extends Exception
-{
- /** serialVersionUID */
- static final long serialVersionUID = -6180939638742159065L;
-
- /**
- * @param message The detailed message.
- */
- public ConfigurationException( String message )
- {
- super( message );
- }
-
- /**
- * @param cause The detailed cause.
- */
- public ConfigurationException( Throwable cause )
- {
- super( cause );
- }
-
- /**
- * @param message The detailed message.
- * @param cause The detailed cause.
- */
- public ConfigurationException( String message, Throwable cause )
- {
- super( message, cause );
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ResolverExpressionEvaluatorStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ResolverExpressionEvaluatorStub.java
deleted file mode 100644
index 623d614..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ResolverExpressionEvaluatorStub.java
+++ /dev/null
@@ -1,140 +0,0 @@
-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 org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-
-/**
- * Stub for {@link ExpressionEvaluator}
- *
- * @author jesse
- * @version $Id$
- */
-public class ResolverExpressionEvaluatorStub
- implements ExpressionEvaluator
-{
- /** {@inheritDoc} */
- public Object evaluate( String expr )
- throws ExpressionEvaluationException
- {
-
- Object value = null;
-
- if ( expr == null )
- {
- return null;
- }
-
- String expression = stripTokens( expr );
-
- if ( expression.equals( expr ) )
- {
- int index = expr.indexOf( "${" );
- if ( index >= 0 )
- {
- int lastIndex = expr.indexOf( "}", index );
- if ( lastIndex >= 0 )
- {
- String retVal = expr.substring( 0, index );
-
- if ( index > 0 && expr.charAt( index - 1 ) == '$' )
- {
- retVal += expr.substring( index + 1, lastIndex + 1 );
- }
- else
- {
- retVal += evaluate( expr.substring( index, lastIndex + 1 ) );
- }
-
- retVal += evaluate( expr.substring( lastIndex + 1 ) );
- return retVal;
- }
- }
-
- // Was not an expression
- if ( expression.indexOf( "$$" ) > -1 )
- {
- return expression.replaceAll( "\\$\\$", "\\$" );
- }
- }
-
- if ( "basedir".equals( expression ) )
- {
- return PlexusTestCase.getBasedir();
- }
- else if ( expression.startsWith( "basedir" ) )
- {
- int pathSeparator = expression.indexOf( "/" );
-
- if ( pathSeparator > 0 )
- {
- value = PlexusTestCase.getBasedir() + expression.substring( pathSeparator );
- }
- else
- {
- System.out.println( "Got expression '" + expression + "' that was not recognised" );
- }
- return value;
- }
- else if ( "localRepository".equals( expression ) )
- {
- File localRepo = new File( PlexusTestCase.getBasedir(), "target/local-repo" );
- return new DefaultArtifactRepository( "localRepository", "file://" + localRepo.getAbsolutePath(),
- new DefaultRepositoryLayout() );
- }
- else
- {
- return expr;
- }
- }
-
- private String stripTokens( String expr )
- {
- if ( expr.startsWith( "${" ) && expr.indexOf( "}" ) == expr.length() - 1 )
- {
- expr = expr.substring( 2, expr.length() - 1 );
- }
-
- return expr;
- }
-
- /** {@inheritDoc} */
- public File alignToBaseDirectory( File file )
- {
- if ( file.getAbsolutePath().startsWith( PlexusTestCase.getBasedir() ) )
- {
- return file;
- }
- else if ( file.isAbsolute() )
- {
- return file;
- }
- else
- {
- return new File( PlexusTestCase.getBasedir(), file.getPath() );
- }
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java
deleted file mode 100644
index 9df3ae7..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/SilentLog.java
+++ /dev/null
@@ -1,328 +0,0 @@
-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 Brian Fox
- * @version $Id$
- */
-public class SilentLog
- implements Log, Logger
-{
- /**
- * @return false
- * @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 false
- * @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 false
- * @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 false
- * @see org.codehaus.plexus.logging.Logger#isFatalErrorEnabled()
- */
- public boolean isFatalErrorEnabled()
- {
- return false;
- }
-
- /**
- * @return null
- * @see org.codehaus.plexus.logging.Logger#getChildLogger(java.lang.String)
- */
- public Logger getChildLogger( String name )
- {
- return null;
- }
-
- /**
- * @return 0
- * @see org.codehaus.plexus.logging.Logger#getThreshold()
- */
- public int getThreshold()
- {
- return 0;
- }
-
- /**
- * @return null
- * @see org.codehaus.plexus.logging.Logger#getName()
- */
- public String getName()
- {
- return null;
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/ArtifactStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/ArtifactStub.java
deleted file mode 100644
index 91ed81b..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/ArtifactStub.java
+++ /dev/null
@@ -1,500 +0,0 @@
-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.Artifact;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Stub class for {@link Artifact} testing.
- *
- * @author jesse
- * @version $Id$
- */
-public class ArtifactStub
- implements Artifact
-{
- private String groupId;
-
- private String artifactId;
-
- private String version;
-
- private String scope;
-
- private String type;
-
- private String classifier;
-
- private File file;
-
- private ArtifactRepository artifactRepository;
-
- /**
- * By default, return 0
- *
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo( Object object )
- {
- return 0;
- }
-
- /** {@inheritDoc} */
- public String getGroupId()
- {
- return groupId;
- }
-
- /** {@inheritDoc} */
- public String getArtifactId()
- {
- return artifactId;
- }
-
- /** {@inheritDoc} */
- public String getVersion()
- {
- return version;
- }
-
- /** {@inheritDoc} */
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- /** {@inheritDoc} */
- public String getScope()
- {
- return scope;
- }
-
- /** {@inheritDoc} */
- public String getType()
- {
- return type;
- }
-
- /**
- * Set a new type
- *
- * @param type
- */
- public void setType( String type )
- {
- this.type = type;
- }
-
- /** {@inheritDoc} */
- public String getClassifier()
- {
- return classifier;
- }
-
- /** {@inheritDoc} */
- public boolean hasClassifier()
- {
- return classifier != null;
- }
-
- /** {@inheritDoc} */
- public File getFile()
- {
- return file;
- }
-
- /** {@inheritDoc} */
- public void setFile( File file )
- {
- this.file = file;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getBaseVersion()
- */
- public String getBaseVersion()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setBaseVersion(java.lang.String)
- */
- public void setBaseVersion( String string )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getId()
- */
- public String getId()
- {
- return null;
- }
-
- /**
- * @return groupId:artifactId:type:classifier.
- * @see org.apache.maven.artifact.Artifact#getDependencyConflictId()
- */
- public String getDependencyConflictId()
- {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append( getGroupId() );
- buffer.append( ":" ).append( getArtifactId() );
- buffer.append( ":" ).append( getType() );
- buffer.append( ":" ).append( getClassifier() );
-
- return buffer.toString();
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#addMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata)
- */
- public void addMetadata( ArtifactMetadata artifactMetadata )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getMetadataList()
- */
- public Collection getMetadataList()
- {
- return null;
- }
-
- /** {@inheritDoc} */
- public void setRepository( ArtifactRepository artifactRepository )
- {
- this.artifactRepository = artifactRepository;
- }
-
- /** {@inheritDoc} */
- public ArtifactRepository getRepository()
- {
- return artifactRepository;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#updateVersion(java.lang.String, org.apache.maven.artifact.repository.ArtifactRepository)
- */
- public void updateVersion( String string, ArtifactRepository artifactRepository )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getDownloadUrl()
- */
- public String getDownloadUrl()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setDownloadUrl(java.lang.String)
- */
- public void setDownloadUrl( String string )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getDependencyFilter()
- */
- public ArtifactFilter getDependencyFilter()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setDependencyFilter(org.apache.maven.artifact.resolver.filter.ArtifactFilter)
- */
- public void setDependencyFilter( ArtifactFilter artifactFilter )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getArtifactHandler()
- */
- public ArtifactHandler getArtifactHandler()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getDependencyTrail()
- */
- public List getDependencyTrail()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setDependencyTrail(java.util.List)
- */
- public void setDependencyTrail( List list )
- {
- // nop
- }
-
- /** {@inheritDoc} */
- public void setScope( String scope )
- {
- this.scope = scope;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getVersionRange()
- */
- public VersionRange getVersionRange()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setVersionRange(org.apache.maven.artifact.versioning.VersionRange)
- */
- public void setVersionRange( VersionRange versionRange )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#selectVersion(java.lang.String)
- */
- public void selectVersion( String string )
- {
- // nop
- }
-
- /** {@inheritDoc} */
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- /** {@inheritDoc} */
- public void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.Artifact#isSnapshot()
- */
- public boolean isSnapshot()
- {
- return Artifact.VERSION_FILE_PATTERN.matcher( getVersion() ).matches()
- || getVersion().endsWith( Artifact.SNAPSHOT_VERSION );
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setResolved(boolean)
- */
- public void setResolved( boolean b )
- {
- // nop
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.Artifact#isResolved()
- */
- public boolean isResolved()
- {
- return false;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setResolvedVersion(java.lang.String)
- */
- public void setResolvedVersion( String string )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setArtifactHandler(org.apache.maven.artifact.handler.ArtifactHandler)
- */
- public void setArtifactHandler( ArtifactHandler artifactHandler )
- {
- // nop
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.Artifact#isRelease()
- */
- public boolean isRelease()
- {
- return !isSnapshot();
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setRelease(boolean)
- */
- public void setRelease( boolean b )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getAvailableVersions()
- */
- public List getAvailableVersions()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.Artifact#setAvailableVersions(java.util.List)
- */
- public void setAvailableVersions( List list )
- {
- // nop
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.Artifact#isOptional()
- */
- public boolean isOptional()
- {
- return false;
- }
-
- /**
- * By default, do nothing.
- *
- * @param b
- */
- public void setOptional( boolean b )
- {
- // nop
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.Artifact#getSelectedVersion()
- */
- public ArtifactVersion getSelectedVersion()
- throws OverConstrainedVersionException
- {
- return null;
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.Artifact#isSelectedVersionKnown()
- */
- public boolean isSelectedVersionKnown()
- throws OverConstrainedVersionException
- {
- return false;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- if ( getGroupId() != null )
- {
- sb.append( getGroupId() );
- sb.append( ":" );
- }
- appendArtifactTypeClassifierString( sb );
- if ( version != null )
- {
- sb.append( ":" );
- sb.append( getVersion() );
- }
- if ( scope != null )
- {
- sb.append( ":" );
- sb.append( scope );
- }
- return sb.toString();
- }
-
- private void appendArtifactTypeClassifierString( StringBuffer sb )
- {
- sb.append( getArtifactId() );
- sb.append( ":" );
- sb.append( getType() );
- if ( hasClassifier() )
- {
- sb.append( ":" );
- sb.append( getClassifier() );
- }
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java
deleted file mode 100644
index 99ee8f7..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/DefaultArtifactHandlerStub.java
+++ /dev/null
@@ -1,202 +0,0 @@
-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 Brian Fox
- * @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 type 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 = getType();
- }
- 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;
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/MavenProjectStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/MavenProjectStub.java
deleted file mode 100644
index 81d20b9..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/MavenProjectStub.java
+++ /dev/null
@@ -1,1508 +0,0 @@
-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.io.File;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.model.Build;
-import org.apache.maven.model.CiManagement;
-import org.apache.maven.model.Contributor;
-import org.apache.maven.model.DependencyManagement;
-import org.apache.maven.model.Developer;
-import org.apache.maven.model.DistributionManagement;
-import org.apache.maven.model.IssueManagement;
-import org.apache.maven.model.License;
-import org.apache.maven.model.MailingList;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Organization;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginManagement;
-import org.apache.maven.model.Prerequisites;
-import org.apache.maven.model.Reporting;
-import org.apache.maven.model.Resource;
-import org.apache.maven.model.Scm;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
-import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-
-/**
- * Very simple stub of MavenProject object, going to take a lot of work to make it
- * useful as a stub though.
- *
- * @author jesse
- * @version $Id$
- */
-public class MavenProjectStub
- extends MavenProject
-{
- private String groupId;
-
- private String artifactId;
-
- private String name;
-
- private Model model;
-
- private MavenProject parent;
-
- private File file;
-
- private List collectedProjects;
-
- private List attachedArtifacts;
-
- private List compileSourceRoots;
-
- private List testCompileSourceRoots;
-
- private List scriptSourceRoots;
-
- private List pluginArtifactRepositories;
-
- private ArtifactRepository releaseArtifactRepository;
-
- private ArtifactRepository snapshotArtifactRepository;
-
- private List activeProfiles;
-
- private Set dependencyArtifacts;
-
- private Artifact artifact;
-
- private Map artifactMap;
-
- private Model originalModel;
-
- private Map pluginArtifactMap;
-
- private Map reportArtifactMap;
-
- private Map extensionArtifactMap;
-
- private Map projectReferences;
-
- private Build buildOverlay;
-
- private boolean executionRoot;
-
- private List compileArtifacts;
-
- private List compileDependencies;
-
- private List systemDependencies;
-
- private List testClasspathElements;
-
- private List testDependencies;
-
- private List systemClasspathElements;
-
- private List systemArtifacts;
-
- private List testArtifacts;
-
- private List runtimeArtifacts;
-
- private List runtimeDependencies;
-
- private List runtimeClasspathElements;
-
- private String modelVersion;
-
- private String packaging;
-
- private String inceptionYear;
-
- private String url;
-
- private String description;
-
- private String version;
-
- private String defaultGoal;
-
- private List licenses;
-
- private Build build;
-
- /**
- * Default constructor
- */
- public MavenProjectStub()
- {
- this( new Model() );
- }
-
- /**
- * @param model the given model
- */
- public MavenProjectStub( Model model )
- {
- super( (Model) null );
- this.model = model;
- }
-
- /**
- * No project model is associated
- *
- * @param project the given project
- */
- public MavenProjectStub( MavenProject project )
- {
- super( (Model) null );
- }
-
- /**
- * @param mavenProject
- * @return an empty String
- * @throws IOException if any
- */
- public String getModulePathAdjustment( MavenProject mavenProject )
- throws IOException
- {
- return "";
- }
-
- /** {@inheritDoc} */
- public Artifact getArtifact()
- {
- return artifact;
- }
-
- /** {@inheritDoc} */
- public void setArtifact( Artifact artifact )
- {
- this.artifact = artifact;
- }
-
- /** {@inheritDoc} */
- public Model getModel()
- {
- return model;
- }
-
- /** {@inheritDoc} */
- public MavenProject getParent()
- {
- return parent;
- }
-
- /** {@inheritDoc} */
- public void setParent( MavenProject mavenProject )
- {
- this.parent = mavenProject;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setRemoteArtifactRepositories(java.util.List)
- */
- public void setRemoteArtifactRepositories( List list )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getRemoteArtifactRepositories()
- */
- public List getRemoteArtifactRepositories()
- {
- return Collections.EMPTY_LIST;
- }
-
- /** {@inheritDoc} */
- public boolean hasParent()
- {
- if ( parent != null )
- {
- return true;
- }
-
- return false;
- }
-
- /** {@inheritDoc} */
- public File getFile()
- {
- return file;
- }
-
- /** {@inheritDoc} */
- public void setFile( File file )
- {
- this.file = file;
- }
-
- /** {@inheritDoc} */
- public File getBasedir()
- {
- return new File( PlexusTestCase.getBasedir() );
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setDependencies(java.util.List)
- */
- public void setDependencies( List list )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getDependencies()
- */
- public List getDependencies()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getDependencyManagement()
- */
- public DependencyManagement getDependencyManagement()
- {
- return null;
- }
-
- /** {@inheritDoc} */
- public void addCompileSourceRoot( String string )
- {
- if ( compileSourceRoots == null )
- {
- compileSourceRoots = new ArrayList( Collections.singletonList( string ) );
- }
- else
- {
- compileSourceRoots.add( string );
- }
- }
-
- /** {@inheritDoc} */
- public void addScriptSourceRoot( String string )
- {
- if ( scriptSourceRoots == null )
- {
- scriptSourceRoots = new ArrayList( Collections.singletonList( string ) );
- }
- else
- {
- scriptSourceRoots.add( string );
- }
- }
-
- /** {@inheritDoc} */
- public void addTestCompileSourceRoot( String string )
- {
- if ( testCompileSourceRoots == null )
- {
- testCompileSourceRoots = new ArrayList( Collections.singletonList( string ) );
- }
- else
- {
- testCompileSourceRoots.add( string );
- }
- }
-
- /** {@inheritDoc} */
- public List getCompileSourceRoots()
- {
- return compileSourceRoots;
- }
-
- /** {@inheritDoc} */
- public List getScriptSourceRoots()
- {
- return scriptSourceRoots;
- }
-
- /** {@inheritDoc} */
- public List getTestCompileSourceRoots()
- {
- return testCompileSourceRoots;
- }
-
- /** {@inheritDoc} */
- public List getCompileClasspathElements()
- throws DependencyResolutionRequiredException
- {
- return compileSourceRoots;
- }
-
- /**
- * @param compileArtifacts
- */
- public void setCompileArtifacts( List compileArtifacts )
- {
- this.compileArtifacts = compileArtifacts;
- }
-
- /** {@inheritDoc} */
- public List getCompileArtifacts()
- {
- return compileArtifacts;
- }
-
- /** {@inheritDoc} */
- public List getCompileDependencies()
- {
- return compileDependencies;
- }
-
- /** {@inheritDoc} */
- public List getTestClasspathElements()
- throws DependencyResolutionRequiredException
- {
- return testClasspathElements;
- }
-
- /** {@inheritDoc} */
- public List getTestArtifacts()
- {
- return testArtifacts;
- }
-
- /** {@inheritDoc} */
- public List getTestDependencies()
- {
- return testDependencies;
- }
-
- /** {@inheritDoc} */
- public List getRuntimeClasspathElements()
- throws DependencyResolutionRequiredException
- {
- return runtimeClasspathElements;
- }
-
- /** {@inheritDoc} */
- public List getRuntimeArtifacts()
- {
- return runtimeArtifacts;
- }
-
- /** {@inheritDoc} */
- public List getRuntimeDependencies()
- {
- return runtimeDependencies;
- }
-
- /** {@inheritDoc} */
- public List getSystemClasspathElements()
- throws DependencyResolutionRequiredException
- {
- return systemClasspathElements;
- }
-
- /** {@inheritDoc} */
- public List getSystemArtifacts()
- {
- return systemArtifacts;
- }
-
- /**
- * @param runtimeClasspathElements
- */
- public void setRuntimeClasspathElements( List runtimeClasspathElements )
- {
- this.runtimeClasspathElements = runtimeClasspathElements;
- }
-
- /**
- * @param attachedArtifacts
- */
- public void setAttachedArtifacts( List attachedArtifacts )
- {
- this.attachedArtifacts = attachedArtifacts;
- }
-
- /**
- * @param compileSourceRoots
- */
- public void setCompileSourceRoots( List compileSourceRoots )
- {
- this.compileSourceRoots = compileSourceRoots;
- }
-
- /**
- * @param testCompileSourceRoots
- */
- public void setTestCompileSourceRoots( List testCompileSourceRoots )
- {
- this.testCompileSourceRoots = testCompileSourceRoots;
- }
-
- /**
- * @param scriptSourceRoots
- */
- public void setScriptSourceRoots( List scriptSourceRoots )
- {
- this.scriptSourceRoots = scriptSourceRoots;
- }
-
- /**
- * @param artifactMap
- */
- public void setArtifactMap( Map artifactMap )
- {
- this.artifactMap = artifactMap;
- }
-
- /**
- * @param pluginArtifactMap
- */
- public void setPluginArtifactMap( Map pluginArtifactMap )
- {
- this.pluginArtifactMap = pluginArtifactMap;
- }
-
- /**
- * @param reportArtifactMap
- */
- public void setReportArtifactMap( Map reportArtifactMap )
- {
- this.reportArtifactMap = reportArtifactMap;
- }
-
- /**
- * @param extensionArtifactMap
- */
- public void setExtensionArtifactMap( Map extensionArtifactMap )
- {
- this.extensionArtifactMap = extensionArtifactMap;
- }
-
- /**
- * @param projectReferences
- */
- public void setProjectReferences( Map projectReferences )
- {
- this.projectReferences = projectReferences;
- }
-
- /**
- * @param buildOverlay
- */
- public void setBuildOverlay( Build buildOverlay )
- {
- this.buildOverlay = buildOverlay;
- }
-
- /**
- * @param compileDependencies
- */
- public void setCompileDependencies( List compileDependencies )
- {
- this.compileDependencies = compileDependencies;
- }
-
- /**
- * @param systemDependencies
- */
- public void setSystemDependencies( List systemDependencies )
- {
- this.systemDependencies = systemDependencies;
- }
-
- /**
- * @param testClasspathElements
- */
- public void setTestClasspathElements( List testClasspathElements )
- {
- this.testClasspathElements = testClasspathElements;
- }
-
- /**
- * @param testDependencies
- */
- public void setTestDependencies( List testDependencies )
- {
- this.testDependencies = testDependencies;
- }
-
- /**
- * @param systemClasspathElements
- */
- public void setSystemClasspathElements( List systemClasspathElements )
- {
- this.systemClasspathElements = systemClasspathElements;
- }
-
- /**
- * @param systemArtifacts
- */
- public void setSystemArtifacts( List systemArtifacts )
- {
- this.systemArtifacts = systemArtifacts;
- }
-
- /**
- * @param testArtifacts
- */
- public void setTestArtifacts( List testArtifacts )
- {
- this.testArtifacts = testArtifacts;
- }
-
- /**
- * @param runtimeArtifacts
- */
- public void setRuntimeArtifacts( List runtimeArtifacts )
- {
- this.runtimeArtifacts = runtimeArtifacts;
- }
-
- /**
- * @param runtimeDependencies
- */
- public void setRuntimeDependencies( List runtimeDependencies )
- {
- this.runtimeDependencies = runtimeDependencies;
- }
-
- /**
- * @param model
- */
- public void setModel( Model model )
- {
- this.model = model;
- }
-
- /** {@inheritDoc} */
- public List getSystemDependencies()
- {
- return systemDependencies;
- }
-
- /** {@inheritDoc} */
- public void setModelVersion( String string )
- {
- this.modelVersion = string;
- }
-
- /** {@inheritDoc} */
- public String getModelVersion()
- {
- return modelVersion;
- }
-
- /**
- * By default, return an empty String.
- *
- * @see org.apache.maven.project.MavenProject#getId()
- */
- public String getId()
- {
- return "";
- }
-
- /** {@inheritDoc} */
- public void setGroupId( String string )
- {
- this.groupId = string;
- }
-
- /** {@inheritDoc} */
- public String getGroupId()
- {
- return groupId;
- }
-
- /** {@inheritDoc} */
- public void setArtifactId( String string )
- {
- this.artifactId = string;
- }
-
- /** {@inheritDoc} */
- public String getArtifactId()
- {
- return artifactId;
- }
-
- /** {@inheritDoc} */
- public void setName( String string )
- {
- this.name = string;
- }
-
- /** {@inheritDoc} */
- public String getName()
- {
- return name;
- }
-
- /** {@inheritDoc} */
- public void setVersion( String string )
- {
- this.version = string;
- }
-
- /** {@inheritDoc} */
- public String getVersion()
- {
- return version;
- }
-
- /** {@inheritDoc} */
- public String getPackaging()
- {
- return packaging;
- }
-
- /** {@inheritDoc} */
- public void setPackaging( String string )
- {
- this.packaging = string;
- }
-
- /** {@inheritDoc} */
- public void setInceptionYear( String string )
- {
- this.inceptionYear = string;
- }
-
- /** {@inheritDoc} */
- public String getInceptionYear()
- {
- return inceptionYear;
- }
-
- /** {@inheritDoc} */
- public void setUrl( String string )
- {
- this.url = string;
- }
-
- /** {@inheritDoc} */
- public String getUrl()
- {
- return url;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getPrerequisites()
- */
- public Prerequisites getPrerequisites()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setIssueManagement(org.apache.maven.model.IssueManagement)
- */
- public void setIssueManagement( IssueManagement issueManagement )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getCiManagement()
- */
- public CiManagement getCiManagement()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setCiManagement(org.apache.maven.model.CiManagement)
- */
- public void setCiManagement( CiManagement ciManagement )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getIssueManagement()
- */
- public IssueManagement getIssueManagement()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setDistributionManagement(org.apache.maven.model.DistributionManagement)
- */
- public void setDistributionManagement( DistributionManagement distributionManagement )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getDistributionManagement()
- */
- public DistributionManagement getDistributionManagement()
- {
- return null;
- }
-
- /** {@inheritDoc} */
- public void setDescription( String string )
- {
- this.description = string;
- }
-
- /** {@inheritDoc} */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setOrganization(org.apache.maven.model.Organization)
- */
- public void setOrganization( Organization organization )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getOrganization()
- */
- public Organization getOrganization()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
- */
- public void setScm( Scm scm )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getScm()
- */
- public Scm getScm()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setMailingLists(java.util.List)
- */
- public void setMailingLists( List list )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getMailingLists()
- */
- public List getMailingLists()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addMailingList(org.apache.maven.model.MailingList)
- */
- public void addMailingList( MailingList mailingList )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setDevelopers(java.util.List)
- */
- public void setDevelopers( List list )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getDevelopers()
- */
- public List getDevelopers()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addDeveloper(org.apache.maven.model.Developer)
- */
- public void addDeveloper( Developer developer )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setContributors(java.util.List)
- */
- public void setContributors( List list )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getContributors()
- */
- public List getContributors()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addContributor(org.apache.maven.model.Contributor)
- */
- public void addContributor( Contributor contributor )
- {
- // nop
- }
-
- /** {@inheritDoc} */
- public void setBuild( Build build )
- {
- this.build = build;
- }
-
- /** {@inheritDoc} */
- public Build getBuild()
- {
- return build;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getResources()
- */
- public List getResources()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getTestResources()
- */
- public List getTestResources()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addResource(org.apache.maven.model.Resource)
- */
- public void addResource( Resource resource )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addTestResource(org.apache.maven.model.Resource)
- */
- public void addTestResource( Resource resource )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setReporting(org.apache.maven.model.Reporting)
- */
- public void setReporting( Reporting reporting )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getReporting()
- */
- public Reporting getReporting()
- {
- return null;
- }
-
- /** {@inheritDoc} */
- public void setLicenses( List licenses )
- {
- this.licenses = licenses;
- }
-
- /** {@inheritDoc} */
- public List getLicenses()
- {
- return licenses;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addLicense(org.apache.maven.model.License)
- */
- public void addLicense( License license )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setArtifacts(java.util.Set)
- */
- public void setArtifacts( Set set )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_SET.
- *
- * @see org.apache.maven.project.MavenProject#getArtifacts()
- */
- public Set getArtifacts()
- {
- return Collections.EMPTY_SET;
- }
-
- /**
- * By default, return Collections.EMPTY_MAP.
- *
- * @see org.apache.maven.project.MavenProject#getArtifactMap()
- */
- public Map getArtifactMap()
- {
- return Collections.EMPTY_MAP;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setPluginArtifacts(java.util.Set)
- */
- public void setPluginArtifacts( Set set )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_SET.
- *
- * @see org.apache.maven.project.MavenProject#getPluginArtifacts()
- */
- public Set getPluginArtifacts()
- {
- return Collections.EMPTY_SET;
- }
-
- /**
- * By default, return Collections.EMPTY_MAP.
- *
- * @see org.apache.maven.project.MavenProject#getPluginArtifactMap()
- */
- public Map getPluginArtifactMap()
- {
- return Collections.EMPTY_MAP;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setReportArtifacts(java.util.Set)
- */
- public void setReportArtifacts( Set set )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_SET.
- *
- * @see org.apache.maven.project.MavenProject#getReportArtifacts()
- */
- public Set getReportArtifacts()
- {
- return Collections.EMPTY_SET;
- }
-
- /**
- * By default, return Collections.EMPTY_MAP.
- *
- * @see org.apache.maven.project.MavenProject#getReportArtifactMap()
- */
- public Map getReportArtifactMap()
- {
- return Collections.EMPTY_MAP;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setExtensionArtifacts(java.util.Set)
- */
- public void setExtensionArtifacts( Set set )
- {
- // nop
- }
-
- /**
- * By default, return Collections.EMPTY_SET.
- *
- * @see org.apache.maven.project.MavenProject#getExtensionArtifacts()
- */
- public Set getExtensionArtifacts()
- {
- return Collections.EMPTY_SET;
- }
-
- /**
- * By default, return Collections.EMPTY_MAP.
- *
- * @see org.apache.maven.project.MavenProject#getExtensionArtifactMap()
- */
- public Map getExtensionArtifactMap()
- {
- return Collections.EMPTY_MAP;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setParentArtifact(org.apache.maven.artifact.Artifact)
- */
- public void setParentArtifact( Artifact artifact )
- {
- // nop
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getParentArtifact()
- */
- public Artifact getParentArtifact()
- {
- return null;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getRepositories()
- */
- public List getRepositories()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getReportPlugins()
- */
- public List getReportPlugins()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getBuildPlugins()
- */
- public List getBuildPlugins()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getModules()
- */
- public List getModules()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getPluginManagement()
- */
- public PluginManagement getPluginManagement()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addPlugin(org.apache.maven.model.Plugin)
- */
- public void addPlugin( Plugin plugin )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @param plugin
- */
- public void injectPluginManagementInfo( Plugin plugin )
- {
- // nop
- }
-
- /** {@inheritDoc} */
- public List getCollectedProjects()
- {
- return collectedProjects;
- }
-
- /** {@inheritDoc} */
- public void setCollectedProjects( List list )
- {
- this.collectedProjects = list;
- }
-
- /** {@inheritDoc} */
- public void setPluginArtifactRepositories( List list )
- {
- this.pluginArtifactRepositories = list;
- }
-
- /** {@inheritDoc} */
- public List getPluginArtifactRepositories()
- {
- return pluginArtifactRepositories;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getDistributionManagementArtifactRepository()
- */
- public ArtifactRepository getDistributionManagementArtifactRepository()
- {
- return null;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getPluginRepositories()
- */
- public List getPluginRepositories()
- {
- return Collections.EMPTY_LIST;
- }
-
- /** {@inheritDoc} */
- public void setActiveProfiles( List list )
- {
- activeProfiles = list;
- }
-
- /** {@inheritDoc} */
- public List getActiveProfiles()
- {
- return activeProfiles;
- }
-
- /** {@inheritDoc} */
- public void addAttachedArtifact( Artifact artifact )
- {
- if ( attachedArtifacts == null )
- {
- this.attachedArtifacts = new ArrayList( Collections.singletonList( artifact ) );
- }
- else
- {
- attachedArtifacts.add( artifact );
- }
- }
-
- /** {@inheritDoc} */
- public List getAttachedArtifacts()
- {
- return attachedArtifacts;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getGoalConfiguration(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public Xpp3Dom getGoalConfiguration( String string, String string1, String string2, String string3 )
- {
- return null;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getReportConfiguration(java.lang.String, java.lang.String, java.lang.String)
- */
- public Xpp3Dom getReportConfiguration( String string, String string1, String string2 )
- {
- return null;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#getExecutionProject()
- */
- public MavenProject getExecutionProject()
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#setExecutionProject(org.apache.maven.project.MavenProject)
- */
- public void setExecutionProject( MavenProject mavenProject )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#writeModel(java.io.Writer)
- */
- public void writeModel( Writer writer )
- throws IOException
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#writeOriginalModel(java.io.Writer)
- */
- public void writeOriginalModel( Writer writer )
- throws IOException
- {
- // nop
- }
-
- /** {@inheritDoc} */
- public Set getDependencyArtifacts()
- {
- return dependencyArtifacts;
- }
-
- /** {@inheritDoc} */
- public void setDependencyArtifacts( Set set )
- {
- this.dependencyArtifacts = set;
- }
-
- /** {@inheritDoc} */
- public void setReleaseArtifactRepository( ArtifactRepository artifactRepository )
- {
- this.releaseArtifactRepository = artifactRepository;
- }
-
- /** {@inheritDoc} */
- public void setSnapshotArtifactRepository( ArtifactRepository artifactRepository )
- {
- this.snapshotArtifactRepository = artifactRepository;
- }
-
- /** {@inheritDoc} */
- public void setOriginalModel( Model model )
- {
- this.originalModel = model;
- }
-
- /** {@inheritDoc} */
- public Model getOriginalModel()
- {
- return originalModel;
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getBuildExtensions()
- */
- public List getBuildExtensions()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_SET.
- *
- * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory, java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
- */
- public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
- throws InvalidDependencyVersionException
- {
- return Collections.EMPTY_SET;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#addProjectReference(org.apache.maven.project.MavenProject)
- */
- public void addProjectReference( MavenProject mavenProject )
- {
- // nop
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.project.MavenProject#attachArtifact(java.lang.String, java.lang.String, java.io.File)
- */
- public void attachArtifact( String string, String string1, File file )
- {
- // nop
- }
-
- /**
- * By default, return a new instance of Properties.
- *
- * @see org.apache.maven.project.MavenProject#getProperties()
- */
- public Properties getProperties()
- {
- return new Properties();
- }
-
- /**
- * By default, return Collections.EMPTY_LIST.
- *
- * @see org.apache.maven.project.MavenProject#getFilters()
- */
- public List getFilters()
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * By default, return Collections.EMPTY_MAP.
- *
- * @see org.apache.maven.project.MavenProject#getProjectReferences()
- */
- public Map getProjectReferences()
- {
- return Collections.EMPTY_MAP;
- }
-
- /** {@inheritDoc} */
- public boolean isExecutionRoot()
- {
- return executionRoot;
- }
-
- /** {@inheritDoc} */
- public void setExecutionRoot( boolean b )
- {
- this.executionRoot = b;
- }
-
- /** {@inheritDoc} */
- public String getDefaultGoal()
- {
- return defaultGoal;
- }
-
- /**
- * By default, return null.
- *
- * @see org.apache.maven.project.MavenProject#replaceWithActiveArtifact(org.apache.maven.artifact.Artifact)
- */
- public Artifact replaceWithActiveArtifact( Artifact artifact )
- {
- return null;
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java
deleted file mode 100644
index 62d9181..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactCollector.java
+++ /dev/null
@@ -1,89 +0,0 @@
-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 Brian Fox
- * @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;
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactRepository.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactRepository.java
deleted file mode 100644
index 22c5751..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactRepository.java
+++ /dev/null
@@ -1,173 +0,0 @@
-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.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-
-/**
- * @author Brian Fox
- * @version $Id$
- */
-public class StubArtifactRepository
- implements ArtifactRepository
-{
- private String baseDir = null;
-
- /**
- * Default constructor
- *
- * @param dir the basedir
- */
- public StubArtifactRepository( String dir )
- {
- baseDir = dir;
- }
-
- /**
- * @return the artifactId.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOf(org.apache.maven.artifact.Artifact)
- */
- public String pathOf( Artifact artifact )
- {
- return artifact.getId();
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfRemoteRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata)
- */
- public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
- {
- return null;
- }
-
- /**
- * @return the filename of this metadata on the local repository.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfLocalRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata, org.apache.maven.artifact.repository.ArtifactRepository)
- */
- public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
- {
- return metadata.getLocalFilename( repository );
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getUrl()
- */
- public String getUrl()
- {
- return null;
- }
-
- /**
- * @return basedir.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getBasedir()
- */
- public String getBasedir()
- {
- return baseDir;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getProtocol()
- */
- public String getProtocol()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getId()
- */
- public String getId()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getSnapshots()
- */
- public ArtifactRepositoryPolicy getSnapshots()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getReleases()
- */
- public ArtifactRepositoryPolicy getReleases()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getLayout()
- */
- public ArtifactRepositoryLayout getLayout()
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#getKey()
- */
- public String getKey()
- {
- return null;
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#isUniqueVersion()
- */
- public boolean isUniqueVersion()
- {
- return false;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.repository.ArtifactRepository#setBlacklisted(boolean)
- */
- public void setBlacklisted( boolean blackListed )
- {
- // nop
- }
-
- /**
- * @return false.
- * @see org.apache.maven.artifact.repository.ArtifactRepository#isBlacklisted()
- */
- public boolean isBlacklisted()
- {
- return false;
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactResolver.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactResolver.java
deleted file mode 100644
index aa4e2d1..0000000
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/stubs/StubArtifactResolver.java
+++ /dev/null
@@ -1,184 +0,0 @@
-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.io.IOException;
-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.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.plugin.testing.ArtifactStubFactory;
-
-/**
- * Stub resolver. The constructor allows the specification of the exception to throw so that handling can be tested too.
- *
- * @author Brian Fox
- * @version $Id$
- */
-public class StubArtifactResolver
- implements ArtifactResolver
-{
- private boolean throwArtifactResolutionException;
-
- private boolean throwArtifactNotFoundException;
-
- private ArtifactStubFactory factory;
-
- /**
- * Default constructor
- *
- * @param factory
- * @param throwArtifactResolutionException
- * @param throwArtifactNotFoundException
- */
- public StubArtifactResolver( ArtifactStubFactory factory, boolean throwArtifactResolutionException,
- boolean throwArtifactNotFoundException )
- {
- this.throwArtifactNotFoundException = throwArtifactNotFoundException;
- this.throwArtifactResolutionException = throwArtifactResolutionException;
- this.factory = factory;
- }
-
- /**
- * Creates dummy file and sets it in the artifact to simulate resolution
- *
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolve(org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository)
- */
- public void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- if ( !this.throwArtifactNotFoundException && !this.throwArtifactResolutionException )
- {
- try
- {
- if ( factory != null )
- {
- factory.setArtifactFile( artifact, factory.getWorkingDir() );
- }
- }
- catch ( IOException e )
- {
- throw new ArtifactResolutionException( "IOException: " + e.getMessage(), artifact, e );
- }
- }
- else
- {
- if ( throwArtifactResolutionException )
- {
- throw new ArtifactResolutionException( "Catch!", artifact );
- }
-
- throw new ArtifactNotFoundException( "Catch!", artifact );
- }
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository, org.apache.maven.artifact.metadata.ArtifactMetadataSource)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- List remoteRepositories, ArtifactRepository localRepository,
- ArtifactMetadataSource source )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository, org.apache.maven.artifact.metadata.ArtifactMetadataSource, java.util.List)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- List remoteRepositories, ArtifactRepository localRepository,
- ArtifactMetadataSource source, List listeners )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- ArtifactRepository localRepository, List remoteRepositories,
- ArtifactMetadataSource source, ArtifactFilter filter )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- Map managedVersions, ArtifactRepository localRepository,
- List remoteRepositories, ArtifactMetadataSource source )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- Map managedVersions, ArtifactRepository localRepository,
- List remoteRepositories, ArtifactMetadataSource source,
- ArtifactFilter filter )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * @return null.
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.List)
- */
- public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
- Map managedVersions, ArtifactRepository localRepository,
- List remoteRepositories, ArtifactMetadataSource source,
- ArtifactFilter filter, List listeners )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- return null;
- }
-
- /**
- * By default, do nothing.
- *
- * @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveAlways(org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository)
- */
- public void resolveAlways( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
- throws ArtifactResolutionException, ArtifactNotFoundException
- {
- // nop
- }
-}
diff --git a/maven-plugin-testing-harness/src/main/resources/META-INF/plexus/components.xml b/maven-plugin-testing-harness/src/main/resources/META-INF/plexus/components.xml
deleted file mode 100644
index 915d02a..0000000
--- a/maven-plugin-testing-harness/src/main/resources/META-INF/plexus/components.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-