[MPLUGINTESTING-65] Remove deprecated maven-plugin-testing-tools module
diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml
index fe87dbe..5bfb02e 100644
--- a/maven-plugin-testing-harness/pom.xml
+++ b/maven-plugin-testing-harness/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing</artifactId>
- <version>3.3.1-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin-testing-harness</artifactId>
diff --git a/maven-plugin-testing-tools/pom.xml b/maven-plugin-testing-tools/pom.xml
deleted file mode 100644
index 34b4ab8..0000000
--- a/maven-plugin-testing-tools/pom.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-plugin-testing</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>maven-plugin-testing-tools</artifactId>
- <name>Maven Plugin Testing Tools</name>
-
- <dependencies>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-compat</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-aether-provider</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-invoker</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-test-tools</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-file</artifactId>
- <version>2.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>maven.home</name>
- <value>${maven.home}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-metadata</artifactId>
- <version>${plexusVersion}</version>
- <executions>
- <execution>
- <goals>
- <goal>generate-metadata</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java
deleted file mode 100644
index e271a4d..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.FileWriter;
-import java.io.IOException;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.maven.shared.invoker.DefaultInvocationRequest;
-import org.apache.maven.shared.invoker.DefaultInvoker;
-import org.apache.maven.shared.invoker.InvocationOutputHandler;
-import org.apache.maven.shared.invoker.InvocationRequest;
-import org.apache.maven.shared.invoker.InvocationResult;
-import org.apache.maven.shared.invoker.Invoker;
-import org.apache.maven.shared.invoker.MavenInvocationException;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-
-/**
- * Test-tool used to execute Maven builds in order to test plugin functionality.
- *
- * @author jdcasey
- * @version $Id$
- */
-@Deprecated
-@Component( role = BuildTool.class )
-public class BuildTool
- implements Initializable, Disposable
-{
- /** Plexus role */
- public static final String ROLE = BuildTool.class.getName();
-
- private Invoker mavenInvoker;
-
- /**
- * Build a standard InvocationRequest using the specified test-build POM, command-line properties,
- * goals, and output logfile. Then, execute Maven using this standard request. Return the result
- * of the invocation.
- *
- * @param pom The test-build POM
- * @param properties command-line properties to fine-tune the test build, or test parameter
- * extraction from CLI properties
- * @param goals The list of goals and/or lifecycle phases to execute during this build
- * @param buildLogFile The logfile used to capture build output
- * @return The result of the Maven invocation, including exit value and any execution exceptions
- * resulting from the Maven invocation.
- * @throws TestToolsException if any
- */
- public InvocationResult executeMaven( File pom, Properties properties, List<String> goals, File buildLogFile )
- throws TestToolsException
- {
- InvocationRequest request = createBasicInvocationRequest( pom, properties, goals, buildLogFile );
-
- return executeMaven( request );
- }
-
- /**
- * Execute a test build using a customized InvocationRequest. Normally, this request would be
- * created using the <code>createBasicInvocationRequest</code> method in this class.
- *
- * @param request The customized InvocationRequest containing the configuration used to execute
- * the current test build
- * @return The result of the Maven invocation, containing exit value, along with any execution
- * exceptions resulting from the [attempted] Maven invocation.
- * @throws TestToolsException if any
- */
- public InvocationResult executeMaven( InvocationRequest request )
- throws TestToolsException
- {
- try
- {
- return mavenInvoker.execute( request );
- }
- catch ( MavenInvocationException e )
- {
- throw new TestToolsException( "Error executing maven.", e );
- }
- finally
- {
- closeHandlers( request );
- }
- }
-
- /**
- * Detect the location of the local Maven installation, and start up the MavenInvoker using that
- * path. Detection uses the system property <code>maven.home</code>, and falls back to the shell
- * environment variable <code>M2_HOME</code>.
- *
- * @throws IOException in case the shell environment variables cannot be read
- */
- private void startInvoker()
- throws IOException
- {
- if ( mavenInvoker == null )
- {
- mavenInvoker = new DefaultInvoker();
-
- if ( System.getProperty( "maven.home" ) == null )
- {
- Properties envars = CommandLineUtils.getSystemEnvVars();
-
- String mavenHome = envars.getProperty( "M2_HOME" );
-
- if ( mavenHome != null )
- {
- mavenInvoker.setMavenHome( new File( mavenHome ) );
- }
- }
- }
- }
-
- /**
- * If we're logging output to a log file using standard output handlers, make sure these are
- * closed.
- *
- * @param request
- */
- private void closeHandlers( InvocationRequest request )
- {
- InvocationOutputHandler outHandler = request.getOutputHandler( null );
-
- if ( outHandler != null && ( outHandler instanceof LoggerHandler ) )
- {
- ( (LoggerHandler) outHandler ).close();
- }
-
- InvocationOutputHandler errHandler = request.getErrorHandler( null );
-
- if ( errHandler != null && ( outHandler == null || errHandler != outHandler )
- && ( errHandler instanceof LoggerHandler ) )
- {
- ( (LoggerHandler) errHandler ).close();
- }
- }
-
- /**
- * Construct a standardized InvocationRequest given the test-build POM, a set of CLI properties,
- * a list of goals to execute, and the location of a log file to which build output should be
- * directed. The resulting InvocationRequest can then be customized by the test class before
- * being used to execute a test build. Both standard-out and standard-error will be directed
- * to the specified log file.
- *
- * @param pom The POM for the test build
- * @param properties The command-line properties for use in this test build
- * @param goals The goals and/or lifecycle phases to execute during the test build
- * @param buildLogFile Location to which build output should be logged
- * @return The standardized InvocationRequest for the test build, ready for any necessary
- * customizations.
- */
- public InvocationRequest createBasicInvocationRequest( File pom, Properties properties, List<String> goals,
- File buildLogFile )
- {
- InvocationRequest request = new DefaultInvocationRequest();
-
- request.setPomFile( pom );
-
- request.setGoals( goals );
-
- request.setProperties( properties );
-
- LoggerHandler handler = new LoggerHandler( buildLogFile );
-
- request.setOutputHandler( handler );
- request.setErrorHandler( handler );
-
- return request;
- }
-
- private static final class LoggerHandler
- implements InvocationOutputHandler
- {
- private static final String LS = System.getProperty( "line.separator" );
-
- private final File output;
-
- private FileWriter writer;
-
- LoggerHandler( File logFile )
- {
- output = logFile;
- }
-
- /** {@inheritDoc} */
- public void consumeLine( String line )
- {
- if ( writer == null )
- {
- try
- {
- output.getParentFile().mkdirs();
- writer = new FileWriter( output );
- }
- catch ( IOException e )
- {
- throw new IllegalStateException( "Failed to open build log: " + output + "\n\nError: "
- + e.getMessage() );
- }
- }
-
- try
- {
- writer.write( line + LS );
- writer.flush();
- }
- catch ( IOException e )
- {
- throw new IllegalStateException( "Failed to write to build log: " + output + " output:\n\n\'" + line
- + "\'\n\nError: " + e.getMessage() );
- }
- }
-
- void close()
- {
- IOUtil.close( writer );
- }
- }
-
- /**
- * Initialize this tool once it's been instantiated and composed, in order to start up the
- * MavenInvoker instance.
- *
- * @throws InitializationException if any
- */
- public void initialize()
- throws InitializationException
- {
- try
- {
- startInvoker();
- }
- catch ( IOException e )
- {
- throw new InitializationException( "Error detecting maven home.", e );
- }
- }
-
- /**
- * Not currently used; when this API switches to use the Maven Embedder, it will be used to
- * shutdown the embedder and its associated container, to free up JVM memory.
- */
- public void dispose()
- {
- // TODO: When we switch to the embedder, use this to deallocate the MavenEmbedder, along
- // with the PlexusContainer and ClassRealm that it wraps.
- }
-}
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ComponentTestTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ComponentTestTool.java
deleted file mode 100644
index 5b9db15..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ComponentTestTool.java
+++ /dev/null
@@ -1,196 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Test tool that provides a single point of access for staging a maven component artifact - along with its
- * POM lineage - into a clean test-time local repository. This involves modifying the component POM to
- * provide a stable test-time version for test-build POMs to reference, then installing the component
- * jar and associated POMs (including those ancestors that are reachable using <relativePath>)
- * into the test local repository.
- *
- * <p>
- * <b>WARNING:</b> Currently, the <code>RepositoryTool</code> will not
- * resolve parent POMs that exist <b>only</b> in your normal local repository, and are not reachable
- * using the relativePath element. This may result in failed test builds, as one or more of the
- * component's ancestor POMs cannot be resolved.
- * </p>
- *
- * @author jdcasey
- * @version $Id$
- */
-@Deprecated
-@Component( role = ComponentTestTool.class )
-public class ComponentTestTool
-{
- /** Plexus role */
- public static final String ROLE = ComponentTestTool.class.getName();
-
- @Requirement
- private ProjectTool projectTool;
-
- @Requirement
- private RepositoryTool repositoryTool;
-
- /**
- * Stage the component, using a stable version, into a temporary local-repository directory that is
- * generated by this method. When the component is staged, return the local repository base directory
- * for use in test builds.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the component, used for reference in test-build POMs and
- * fully-qualified goals
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File prepareComponentForIntegrationTesting( File pomFile, String testVersion )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, false, null );
- }
-
- /**
- * Stage the component, using a stable version, into a temporary local-repository directory that is
- * generated by this method. When the component is staged, return the local repository base directory
- * for use in test builds. This method also skips unit testing during component jar production,
- * since it is assumed that executing these tests would lead to a recursive test-and-build loop.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the component, used for reference in test-build POMs and
- * fully-qualified goals
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File prepareComponentForUnitTestingWithMavenBuilds( File pomFile, String testVersion )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, true, null );
- }
-
- /**
- * Stage the component, using a stable version, into the specified local-repository directory.
- * When the component is staged, return the local repository base directory for verification.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the component, used for reference in test-build POMs and
- * fully-qualified goals
- * @param localRepositoryDir The base-directory location of the test local repository, into which
- * the component's test version should be staged.
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File prepareComponentForIntegrationTesting( File pomFile, String testVersion, File localRepositoryDir )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, false, localRepositoryDir );
- }
-
- /**
- * Stage the component, using a stable version, into the specified local-repository directory.
- * When the component is staged, return the local repository base directory for verification. This
- * method also skips unit testing during component jar production, since it is assumed that
- * executing these tests would lead to a recursive test-and-build loop.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the component, used for reference in test-build POMs and
- * fully-qualified goals
- * @param localRepositoryDir The base-directory location of the test local repository, into which
- * the component's test version should be staged.
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File prepareComponentForUnitTestingWithMavenBuilds( File pomFile, String testVersion,
- File localRepositoryDir )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, true, localRepositoryDir );
- }
-
- private File prepareForTesting( File pomFile, String testVersion, boolean skipUnitTests, File localRepositoryDir )
- throws TestToolsException
- {
- File realProjectDir = pomFile.getParentFile();
- try
- {
- realProjectDir = realProjectDir.getCanonicalFile();
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Failed to stage component for testing.", e );
- }
-
- try
- {
- final File tmpDir = File.createTempFile( "component-IT-staging-project", "" );
-
- tmpDir.delete();
-
- tmpDir.mkdirs();
-
- Runtime.getRuntime().addShutdownHook( new Thread( new Runnable()
- {
- public void run()
- {
- try
- {
- FileUtils.deleteDirectory( tmpDir );
- }
- catch ( IOException e )
- {
- // it'll get cleaned up when the temp dir is purged next...
- }
- }
-
- } ) );
-
- FileUtils.copyDirectoryStructure( realProjectDir, tmpDir );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Failed to create temporary staging directory for component project.", e );
- }
-
- File buildLog = new File( "target/test-build-logs/setup.build.log" );
-
- buildLog.getParentFile().mkdirs();
-
- File localRepoDir = localRepositoryDir;
-
- if ( localRepoDir == null )
- {
- localRepoDir = new File( "target/test-local-repository" );
- }
-
- MavenProject project = projectTool.packageProjectArtifact( pomFile, testVersion, skipUnitTests, buildLog );
-
- repositoryTool.createLocalRepositoryFromComponentProject( project, new File( realProjectDir, "pom.xml" ),
- localRepoDir );
-
- return localRepoDir;
- }
-}
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/PluginTestTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/PluginTestTool.java
deleted file mode 100644
index 0f78d9a..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/PluginTestTool.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Test tool that provides a single point of access for staging a plugin artifact - along with its
- * POM lineage - into a clean test-time local repository. This involves modifying the plugin POM to
- * provide a stable test-time version for test-build POMs to reference, then installing the plugin
- * jar and associated POMs (including those ancestors that are reachable using <relativePath>)
- * into the test local repository.
- *
- * <p>
- * <b>WARNING:</b> Currently, the <code>RepositoryTool</code> will not
- * resolve parent POMs that exist <b>only</b> in your normal local repository, and are not reachable
- * using the relativePath element. This may result in failed test builds, as one or more of the
- * plugin's ancestor POMs cannot be resolved.
- * </p>
- *
- * @author jdcasey
- * @version $Id$
- */
-@Deprecated
-@Component( role = PluginTestTool.class )
-public class PluginTestTool
-{
- /** Plexus role */
- public static final String ROLE = PluginTestTool.class.getName();
-
- @Requirement
- private ProjectTool projectTool;
-
- @Requirement
- private RepositoryTool repositoryTool;
-
- /**
- * Stage the plugin, using a stable version, into a temporary local-repository directory that is
- * generated by this method. When the plugin is staged, return the local repository base directory
- * for use in test builds.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the plugin, used for reference in test-build POMs and
- * fully-qualified goals
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File preparePluginForIntegrationTesting( File pomFile, String testVersion )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, false, null );
- }
-
- /**
- * Stage the plugin, using a stable version, into a temporary local-repository directory that is
- * generated by this method. When the plugin is staged, return the local repository base directory
- * for use in test builds. This method also skips unit testing during plugin jar production,
- * since it is assumed that executing these tests would lead to a recursive test-and-build loop.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the plugin, used for reference in test-build POMs and
- * fully-qualified goals
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File preparePluginForUnitTestingWithMavenBuilds( File pomFile, String testVersion )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, true, null );
- }
-
- /**
- * Stage the plugin, using a stable version, into the specified local-repository directory.
- * When the plugin is staged, return the local repository base directory for verification.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the plugin, used for reference in test-build POMs and
- * fully-qualified goals
- * @param localRepositoryDir The base-directory location of the test local repository, into which
- * the plugin's test version should be staged.
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File preparePluginForIntegrationTesting( File pomFile, String testVersion, File localRepositoryDir )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, false, localRepositoryDir );
- }
-
- /**
- * Stage the plugin, using a stable version, into the specified local-repository directory.
- * When the plugin is staged, return the local repository base directory for verification. This
- * method also skips unit testing during plugin jar production, since it is assumed that
- * executing these tests would lead to a recursive test-and-build loop.
- *
- * @param pomFile current POM file
- * @param testVersion The test version for the plugin, used for reference in test-build POMs and
- * fully-qualified goals
- * @param localRepositoryDir The base-directory location of the test local repository, into which
- * the plugin's test version should be staged.
- * @return The base-directory location of the generated local repository
- * @throws TestToolsException if any
- */
- public File preparePluginForUnitTestingWithMavenBuilds( File pomFile, String testVersion, File localRepositoryDir )
- throws TestToolsException
- {
- return prepareForTesting( pomFile, testVersion, true, localRepositoryDir );
- }
-
- private File prepareForTesting( File pomFile, String testVersion, boolean skipUnitTests, File localRepositoryDir )
- throws TestToolsException
- {
- File realProjectDir = pomFile.getParentFile();
-
- try
- {
- realProjectDir = realProjectDir.getCanonicalFile();
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Failed to stage plugin for testing.", e );
- }
-
- try
- {
- final File tmpDir = File.createTempFile( "plugin-IT-staging-project", "" );
-
- tmpDir.delete();
-
- tmpDir.mkdirs();
-
- Runtime.getRuntime().addShutdownHook( new Thread( new Runnable()
- {
-
- public void run()
- {
- try
- {
- FileUtils.deleteDirectory( tmpDir );
- }
- catch ( IOException e )
- {
- // it'll get cleaned up when the temp dir is purged next...
- }
- }
-
- } ) );
-
- FileUtils.copyDirectoryStructure( realProjectDir, tmpDir );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Failed to create temporary staging directory for plugin project.", e );
- }
-
- File buildLog = new File( "target/test-build-logs/setup.build.log" );
-
- buildLog.getParentFile().mkdirs();
-
- File localRepoDir = localRepositoryDir;
-
- if ( localRepoDir == null )
- {
- localRepoDir = new File( "target/test-local-repository" );
- }
-
- MavenProject project = projectTool.packageProjectArtifact( pomFile, testVersion, skipUnitTests, buildLog );
-
- repositoryTool.createLocalRepositoryFromComponentProject( project, new File( realProjectDir, "pom.xml" ),
- localRepoDir );
-
- return localRepoDir;
- }
-
-}
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
deleted file mode 100644
index 9480017..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
+++ /dev/null
@@ -1,494 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.UnknownRepositoryLayoutException;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.model.Build;
-import org.apache.maven.model.DeploymentRepository;
-import org.apache.maven.model.DistributionManagement;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.Repository;
-import org.apache.maven.model.Site;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.project.DefaultProjectBuildingRequest;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.WriterFactory;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Testing tool used to read MavenProject instances from pom.xml files, and to create plugin jar
- * files (package phase of the normal build process) for distribution to a test local repository
- * directory.
- *
- * @author jdcasey
- * @version $Id$
- */
-@Deprecated
-@Component( role = ProjectTool.class )
-public class ProjectTool
-{
- /** Plexus role */
- public static final String ROLE = ProjectTool.class.getName();
-
- public static final String INTEGRATION_TEST_DEPLOYMENT_REPO_URL = "integration-test.deployment.repo.url";
-
- @Requirement
- private BuildTool buildTool;
-
- @Requirement
- private RepositoryTool repositoryTool;
-
- @Requirement
- private ProjectBuilder projectBuilder;
-
- @Requirement
- private ArtifactHandlerManager artifactHandlerManager;
-
- @Requirement
- private ArtifactFactory artifactFactory;
-
- @Requirement
- private ArtifactRepositoryFactory artifactRepositoryFactory;
-
- /**
- * Construct a MavenProject instance from the specified POM file.
- *
- * @param pomFile current POM file
- * @return the Maven project from a file
- * @throws TestToolsException if any
- */
- public MavenProject readProject( File pomFile )
- throws TestToolsException
- {
- return readProject( pomFile, repositoryTool.findLocalRepositoryDirectory() );
- }
-
- /**
- * Construct a MavenProject instance from the specified POM file, using the specified local
- * repository directory to resolve ancestor POMs as needed.
- *
- * @param pomFile current POM file
- * @param localRepositoryBasedir
- * @return the Maven project from a file and a local repo
- * @throws TestToolsException if any
- */
- public MavenProject readProject( File pomFile, File localRepositoryBasedir )
- throws TestToolsException
- {
- try
- {
- ArtifactRepository localRepository = repositoryTool
- .createLocalArtifactRepositoryInstance( localRepositoryBasedir );
-
- ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
- return projectBuilder.build( pomFile, request ).getProject();
- }
- catch ( ProjectBuildingException e )
- {
- throw new TestToolsException( "Error building MavenProject instance from test pom: " + pomFile, e );
- }
- }
-
- /**
- * Construct a MavenProject instance from the specified POM file with dependencies.
- *
- * @param pomFile current POM file
- * @return the Maven project with dependencies from a file
- * @throws TestToolsException if any
- */
- public MavenProject readProjectWithDependencies( File pomFile )
- throws TestToolsException
- {
- return readProjectWithDependencies( pomFile, repositoryTool.findLocalRepositoryDirectory() );
- }
-
- /**
- * Construct a MavenProject instance from the specified POM file with dependencies, using the specified local
- * repository directory to resolve ancestor POMs as needed.
- *
- * @param pomFile current POM file
- * @param localRepositoryBasedir
- * @return the Maven project with dependencies from a file and a local repo
- * @throws TestToolsException if any
- */
- public MavenProject readProjectWithDependencies( File pomFile, File localRepositoryBasedir )
- throws TestToolsException
- {
- try
- {
- ArtifactRepository localRepository = repositoryTool
- .createLocalArtifactRepositoryInstance( localRepositoryBasedir );
-
- ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
- return projectBuilder.build( pomFile, request ).getProject();
- }
- catch ( ProjectBuildingException e )
- {
- throw new TestToolsException( "Error building MavenProject instance from test pom: " + pomFile, e );
- }
- }
-
- /**
- * Run the plugin's Maven build up to the package phase, in order to produce a jar file for
- * distribution to a test-time local repository. The testVersion parameter specifies the version
- * to be used in the <version/> element of the plugin configuration, and also in fully
- * qualified, unambiguous goal invocations (as in
- * org.apache.maven.plugins:maven-eclipse-plugin:test:eclipse).
- *
- * @param pomFile The plugin's POM
- * @param testVersion The version to use for testing this plugin. To promote test resiliency,
- * this version should remain unchanged, regardless of what plugin version is under
- * development.
- * @param skipUnitTests In cases where test builds occur during the unit-testing phase (usually
- * a bad testing smell), the plugin jar must be produced <b>without</b> running unit tests.
- * Otherwise, the testing process will result in a recursive loop of building a plugin jar and
- * trying to unit test it during the build. In these cases, set this flag to <code>true</code>.
- * @return The resulting MavenProject, after the test version and skip flag (for unit tests)
- * have been appropriately configured.
- * @throws TestToolsException if any
- */
- public MavenProject packageProjectArtifact( File pomFile, String testVersion, boolean skipUnitTests )
- throws TestToolsException
- {
- return packageProjectArtifact( pomFile, testVersion, skipUnitTests, null );
- }
-
- /**
- * Run the plugin's Maven build up to the package phase, in order to produce a jar file for
- * distribution to a test-time local repository. The testVersion parameter specifies the version
- * to be used in the <version/> element of the plugin configuration, and also in fully
- * qualified, unambiguous goal invocations (as in
- * org.apache.maven.plugins:maven-eclipse-plugin:test:eclipse).
- *
- * @param pomFile The plugin's POM
- * @param testVersion The version to use for testing this plugin. To promote test resiliency,
- * this version should remain unchanged, regardless of what plugin version is under
- * development.
- * @param skipUnitTests In cases where test builds occur during the unit-testing phase (usually
- * a bad testing smell), the plugin jar must be produced <b>without</b> running unit tests.
- * Otherwise, the testing process will result in a recursive loop of building a plugin jar and
- * trying to unit test it during the build. In these cases, set this flag to <code>true</code>.
- * @param logFile The file to which build output should be logged, in order to allow later
- * inspection in case this build fails.
- * @return The resulting MavenProject, after the test version and skip flag (for unit tests)
- * have been appropriately configured.
- * @throws TestToolsException if any
- */
- public MavenProject packageProjectArtifact( File pomFile, String testVersion, boolean skipUnitTests, File logFile )
- throws TestToolsException
- {
- PomInfo pomInfo = manglePomForTesting( pomFile, testVersion, skipUnitTests );
-
- Properties properties = new Properties();
-
- List<String> goals = new ArrayList<String>();
- goals.add( "package" );
-
- File buildLog = logFile == null ? pomInfo.getBuildLogFile() : logFile;
- System.out.println( "Now Building test version of the plugin...\nUsing staged plugin-pom: "
- + pomInfo.getPomFile().getAbsolutePath() );
-
- buildTool.executeMaven( pomInfo.getPomFile(), properties, goals, buildLog );
-
- File artifactFile = new File( pomInfo.getPomFile().getParentFile(),
- pomInfo.getBuildDirectory() + "/" + pomInfo.getFinalName() );
- System.out.println( "Using IT Plugin Jar: " + artifactFile.getAbsolutePath() );
- try
- {
- ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
- request.setLocalRepository( artifactRepositoryFactory.createArtifactRepository( "local",
- new File( "target/localrepo" ).getCanonicalFile().toURL().toExternalForm(),
- "default", null, null ) );
- request.setRepositorySession( MavenRepositorySystemUtils.newSession() );
- MavenProject project = projectBuilder.build( pomInfo.getPomFile(), request ).getProject();
-
- Artifact artifact = artifactFactory.createArtifact( project.getGroupId(), project.getArtifactId(), project
- .getVersion(), null, project.getPackaging() );
-
- artifact.setFile( artifactFile );
- artifact.addMetadata( new ProjectArtifactMetadata( artifact, project.getFile() ) );
-
- project.setArtifact( artifact );
-
- return project;
- }
- catch ( ProjectBuildingException e )
- {
- throw new TestToolsException( "Error building MavenProject instance from test pom: " + pomInfo.getPomFile(),
- e );
- }
- catch ( UnknownRepositoryLayoutException e )
- {
- throw new TestToolsException( "Error building ArtifactRepository instance from test pom: "
- + pomInfo.getPomFile(), e );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Error building ArtifactRepository instance from test pom: "
- + pomInfo.getPomFile(), e );
- }
- }
-
- /**
- * Inject a special version for testing, to allow tests to unambiguously reference the plugin
- * currently under test. If test builds will be executed from the unit-testing phase, also inject
- * <skip>true</skip> into the configuration of the <code>maven-surefire-plugin</code>
- * to allow production of a test-only version of the plugin jar without running unit tests.
- *
- * @param pomFile The plugin POM
- * @param testVersion The version that allows test builds to reference the plugin under test
- * @param skipUnitTests If true, configure the surefire plugin to skip unit tests
- * @return Information about mangled POM, including the temporary file to which it was written.
- * @throws TestToolsException if any
- */
- protected PomInfo manglePomForTesting( File pomFile, String testVersion, boolean skipUnitTests )
- throws TestToolsException
- {
- File input = pomFile;
-
- File output = new File( pomFile.getParentFile(), "pom-" + testVersion + ".xml" );
- output.deleteOnExit();
-
- Reader reader = null;
- Writer writer = null;
-
- Model model = null;
- String finalName = null;
- String buildDirectory = null;
-
- try
- {
- reader = ReaderFactory.newXmlReader( input );
-
- model = new MavenXpp3Reader().read( reader );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Error creating test-time version of POM for: " + input, e );
- }
- catch ( XmlPullParserException e )
- {
- throw new TestToolsException( "Error creating test-time version of POM for: " + input, e );
- }
- finally
- {
- IOUtil.close( reader );
- }
-
- try
- {
- model.setVersion( testVersion );
-
- Build build = model.getBuild();
- if ( build == null )
- {
- build = new Build();
- }
- buildDirectory = build.getDirectory();
-
- if ( buildDirectory == null )
- {
- buildDirectory = "target";
- }
-
- buildDirectory = ( buildDirectory + File.separatorChar + "it-build-target" );
- build.setDirectory( buildDirectory );
- build.setOutputDirectory( buildDirectory + File.separatorChar + "classes" );
- System.out.println( "Using " + build.getDirectory() + " and " + build.getOutputDirectory()
- + " to build IT version of plugin" );
- model.setBuild( build );
-
- finalName = build.getFinalName();
-
- if ( finalName == null )
- {
- ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( model.getPackaging() );
-
- String ext = handler.getExtension();
-
- finalName = model.getArtifactId() + "-" + model.getVersion() + "." + ext;
- }
-
- DistributionManagement distMgmt = new DistributionManagement();
-
- DeploymentRepository deployRepo = new DeploymentRepository();
-
- deployRepo.setId( "integration-test.output" );
-
- File tmpDir = FileUtils.createTempFile( "integration-test-repo", "", null );
- String tmpUrl = tmpDir.toURL().toExternalForm();
-
- deployRepo.setUrl( tmpUrl );
-
- distMgmt.setRepository( deployRepo );
- distMgmt.setSnapshotRepository( deployRepo );
-
- Repository localAsRemote = new Repository();
- localAsRemote.setId( "testing.mainLocalAsRemote" );
-
- File localRepoDir = repositoryTool.findLocalRepositoryDirectory();
- localAsRemote.setUrl( localRepoDir.toURL().toExternalForm() );
-
- model.addRepository( localAsRemote );
- model.addPluginRepository( localAsRemote );
-
- Site site = new Site();
-
- site.setId( "integration-test.output" );
- site.setUrl( tmpUrl );
-
- distMgmt.setSite( site );
-
- model.setDistributionManagement( distMgmt );
-
- model.addProperty( INTEGRATION_TEST_DEPLOYMENT_REPO_URL, tmpUrl );
-
- if ( skipUnitTests )
- {
- List<Plugin> plugins = build.getPlugins();
- Plugin plugin = null;
- for ( Plugin plug : plugins )
- {
- if ( "maven-surefire-plugin".equals( plug.getArtifactId() ) )
- {
- plugin = plug;
- break;
- }
- }
-
- if ( plugin == null )
- {
- plugin = new Plugin();
- plugin.setArtifactId( "maven-surefire-plugin" );
- build.addPlugin( plugin );
- }
-
- Xpp3Dom configDom = (Xpp3Dom) plugin.getConfiguration();
- if ( configDom == null )
- {
- configDom = new Xpp3Dom( "configuration" );
- plugin.setConfiguration( configDom );
- }
-
- Xpp3Dom skipDom = new Xpp3Dom( "skip" );
- skipDom.setValue( "true" );
-
- configDom.addChild( skipDom );
- }
-
- writer = WriterFactory.newXmlWriter( output );
-
- new MavenXpp3Writer().write( writer, model );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Error creating test-time version of POM for: " + input, e );
- }
- finally
- {
- IOUtil.close( writer );
- }
-
- return new PomInfo( output, model.getGroupId(), model.getArtifactId(), model.getVersion(),
- model.getBuild().getDirectory(), model.getBuild().getOutputDirectory(), finalName );
- }
-
- static final class PomInfo
- {
- private final File pomFile;
-
- private final String groupId;
-
- private final String artifactId;
-
- private final String version;
-
- private final String finalName;
-
- private final String buildDirectory;
-
- private final String buildOutputDirectory;
-
- PomInfo( File pomFile, String groupId, String artifactId, String version, String buildDirectory,
- String buildOutputDirectory, String finalName )
- {
- this.pomFile = pomFile;
- this.groupId = groupId;
- this.artifactId = artifactId;
- this.version = version;
- this.buildDirectory = buildDirectory;
- this.buildOutputDirectory = buildOutputDirectory;
- this.finalName = finalName;
- }
-
- File getPomFile()
- {
- return pomFile;
- }
-
- String getBuildDirectory()
- {
- return buildDirectory;
- }
-
- String getBuildOutputDirectory()
- {
- return buildOutputDirectory;
- }
-
- String getFinalName()
- {
- return finalName;
- }
-
- File getBuildLogFile()
- {
- return new File( buildDirectory + "/test-build-logs/" + groupId + "_" + artifactId + "_" + version
- + ".build.log" );
- }
- }
-}
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java
deleted file mode 100644
index d2d1bf1..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java
+++ /dev/null
@@ -1,354 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.Reader;
-import java.net.MalformedURLException;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.installer.ArtifactInstallationException;
-import org.apache.maven.artifact.installer.ArtifactInstaller;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.execution.DefaultMavenExecutionRequest;
-import org.apache.maven.execution.DefaultMavenExecutionResult;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.plugin.LegacySupport;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
-import org.apache.maven.settings.MavenSettingsBuilder;
-import org.apache.maven.settings.Settings;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Tools to access and manage Maven repositories for test builds, including construction of a local
- * repository directory structure.
- *
- * <p>
- * <b>WARNING:</b> Currently, the <code>createLocalRepositoryFromPlugin</code> method will not
- * resolve parent POMs that exist <b>only</b> in your normal local repository, and are not reachable
- * using the relativePath element. This may result in failed test builds, as one or more of the
- * plugin's ancestor POMs cannot be resolved.
- * </p>
- *
- * @author jdcasey
- * @version $Id$
- */
-@Deprecated
-@Component( role = RepositoryTool.class )
-public class RepositoryTool
- implements Contextualizable
-{
- /** Plexus role */
- public static final String ROLE = RepositoryTool.class.getName();
-
- @Requirement
- private ArtifactRepositoryFactory repositoryFactory;
-
- @Requirement
- private MavenSettingsBuilder settingsBuilder;
-
- @Requirement
- private ArtifactFactory artifactFactory;
-
- @Requirement
- private ArtifactInstaller artifactInstaller;
-
- @Requirement
- private LegacySupport legacySupport;
-
- // contextualized.
- private PlexusContainer container;
-
- /**
- * Lookup and return the location of the normal Maven local repository.
- *
- * @return the location of the normal Maven local repository.
- * @throws TestToolsException if any
- */
- public File findLocalRepositoryDirectory()
- throws TestToolsException
- {
- String localRepo = System.getProperty( "maven.local.repo" );
- if ( StringUtils.isNotEmpty( localRepo ) )
- {
- return new File( localRepo );
- }
-
- Settings settings;
- try
- {
- DefaultMavenExecutionRequest request = new DefaultMavenExecutionRequest();
- request.setUserSettingsFile( new File( System.getProperty( "user.home" ), ".m2/settings.xml" ) );
- request.setGlobalSettingsFile( new File( System.getProperty( "maven.home" ), "conf/settings.xml" ) );
- settings = settingsBuilder.buildSettings( request );
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Error building Maven settings.", e );
- }
- catch ( XmlPullParserException e )
- {
- throw new TestToolsException( "Error building Maven settings.", e );
- }
-
- if ( settings == null || settings.getLocalRepository() == null
- || settings.getLocalRepository().trim().length() < 1 )
- {
- return new File( System.getProperty( "user.home" ), ".m2/repository" );
- }
-
- return new File( settings.getLocalRepository() );
- }
-
- /**
- * Construct an ArtifactRepository instance that refers to the normal Maven local repository.
- *
- * @return an ArtifactRepository instance
- * @throws TestToolsException if any
- */
- public ArtifactRepository createLocalArtifactRepositoryInstance()
- throws TestToolsException
- {
- File localRepoDir = findLocalRepositoryDirectory();
-
- return createLocalArtifactRepositoryInstance( localRepoDir );
- }
-
- /**
- * Construct an ArtifactRepository instance that refers to the test-time Maven local repository.
- *
- * @param localRepositoryDirectory The location of the local repository to be used for test builds.
- * @return an ArtifactRepository instance
- * @throws TestToolsException if any
- */
- public ArtifactRepository createLocalArtifactRepositoryInstance( File localRepositoryDirectory )
- throws TestToolsException
- {
- ArtifactRepositoryLayout defaultLayout;
- try
- {
- defaultLayout = (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, "default" );
- }
- catch ( ComponentLookupException e )
- {
- throw new TestToolsException( "Error retrieving default repository layout.", e );
- }
-
- try
- {
- return repositoryFactory.createArtifactRepository( "local", localRepositoryDirectory.toURL()
- .toExternalForm(), defaultLayout, null, null );
- }
- catch ( MalformedURLException e )
- {
- throw new TestToolsException( "Error converting local repo directory to a URL.", e );
- }
- }
-
- /**
- * Install a test version of a plugin - along with its POM, and as many ancestor POMs as can be
- * reached using the <relativePath/> element - to a clean local repository directory for
- * use in test builds.
- *
- * <p>
- * <b>WARNING:</b> Currently, this method will not resolve parent POMs that exist <b>only</b> in
- * your normal local repository, and are not reachable using the relativePath element. This may
- * result in failed test builds, as one or more of the plugin's ancestor POMs cannot be resolved.
- * </p>
- *
- * @param project
- * @param realPomFile
- * @param targetLocalRepoBasedir
- * @throws TestToolsException if any
- */
- public void createLocalRepositoryFromComponentProject( MavenProject project, File realPomFile,
- File targetLocalRepoBasedir )
- throws TestToolsException
- {
- Artifact artifact = project.getArtifact();
-
- if ( "pom".equals( project.getPackaging() ) )
- {
- artifact.setFile( project.getFile() );
- }
-
- ArtifactRepository localRepository = createLocalArtifactRepositoryInstance( targetLocalRepoBasedir );
-
- String localPath = localRepository.pathOf( artifact );
-
- File destination = new File( localRepository.getBasedir(), localPath );
- if ( !destination.getParentFile().exists() )
- {
- destination.getParentFile().mkdirs();
- }
-
- legacySupport.setSession( new MavenSession( container, MavenRepositorySystemUtils.newSession(),
- new DefaultMavenExecutionRequest(),
- new DefaultMavenExecutionResult() ) );
- try
- {
- artifactInstaller.install( artifact.getFile(), artifact, localRepository );
- }
- catch ( ArtifactInstallationException e )
- {
- throw new TestToolsException( "Error installing plugin artifact to target local repository: "
- + targetLocalRepoBasedir, e );
- }
- finally
- {
- legacySupport.setSession( null );
- }
-
- installLocallyReachableAncestorPoms( realPomFile, localRepository );
- }
-
- /**
- * Traverse <relativePath/> links for successive POMs in the plugin's ancestry, installing
- * each one into the test-time local repository.
- *
- * @param realPomFile The real plugin POM; a starting point, but the POM is already installed,
- * so we won't actually install this file, only use it to locate parents.
- * @param localRepo The test-time local repository instance
- * @throws TestToolsException if any
- */
- private void installLocallyReachableAncestorPoms( File realPomFile, ArtifactRepository localRepo )
- throws TestToolsException
- {
- MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
- File pom = realPomFile;
-
- boolean firstPass = true;
-
- while ( pom != null )
- {
-
- if ( !pom.exists() )
- {
- pom = null;
- break;
- }
-
- String pomGroupId = null;
- String pomArtifactId = null;
- String pomVersion = null;
-
- Reader reader = null;
-
- File currentPom = pom;
-
- try
- {
- reader = ReaderFactory.newXmlReader( pom );
-
- Model model = pomReader.read( reader );
-
- pomGroupId = model.getGroupId();
- pomArtifactId = model.getArtifactId();
- pomVersion = model.getVersion();
-
- Parent parent = model.getParent();
- if ( parent != null )
- {
- pom = new File( pom.getParentFile(), parent.getRelativePath() );
-
- if ( pomGroupId == null )
- {
- pomGroupId = parent.getGroupId();
- }
-
- if ( pomVersion == null )
- {
- pomVersion = parent.getVersion();
- }
- }
- else
- {
- pom = null;
- }
- }
- catch ( IOException e )
- {
- throw new TestToolsException( "Error reading ancestor POM: " + currentPom, e );
- }
- catch ( XmlPullParserException e )
- {
- throw new TestToolsException( "Error reading ancestor POM: " + currentPom, e );
- }
- finally
- {
- IOUtil.close( reader );
- }
-
- if ( !firstPass )
- {
- Artifact pomArtifact = artifactFactory.createProjectArtifact( pomGroupId, pomArtifactId, pomVersion );
- pomArtifact.addMetadata( new ProjectArtifactMetadata( pomArtifact, currentPom ) );
-
- try
- {
- artifactInstaller.install( currentPom, pomArtifact, localRepo );
- }
- catch ( ArtifactInstallationException e )
- {
- throw new TestToolsException( "Error installing ancestor POM: " + currentPom
- + " to target local repository: " + localRepo.getBasedir(), e );
- }
- }
- else
- {
- firstPass = false;
- }
- }
- }
-
- /**
- * Retrieve the PlexusContainer instance used to instantiate this component. The container is
- * used to retrieve the default ArtifactRepositoryLayout component, for use in constructing
- * instances of ArtifactRepository that can be used to access local repositories.
- *
- * @see org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable#contextualize(org.codehaus.plexus.context.Context)
- */
- public void contextualize( Context context )
- throws ContextException
- {
- this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
- }
-}
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/TestToolsException.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/TestToolsException.java
deleted file mode 100644
index f4eec3e..0000000
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/TestToolsException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.
- */
-
-/**
- * Wrap errors when Test Tools exception occurred.
- *
- * @version $Id$
- */
-@Deprecated
-public class TestToolsException
- extends Exception
-{
- static final long serialVersionUID = -2578830270609952507L;
-
- /**
- * @param message given message
- * @param cause given cause
- */
- public TestToolsException( String message, Throwable cause )
- {
- super( message, cause );
- }
-
- /**
- * @param message a given message
- */
- public TestToolsException( String message )
- {
- super( message );
- }
-}
diff --git a/maven-plugin-testing-tools/src/site/apt/index.apt b/maven-plugin-testing-tools/src/site/apt/index.apt
deleted file mode 100644
index 08143c1..0000000
--- a/maven-plugin-testing-tools/src/site/apt/index.apt
+++ /dev/null
@@ -1,145 +0,0 @@
- ---
- Introduction
- ---
- John Casey
- ---
- 13 November 2006
- ---
-
-~~ 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.
-
-~~ NOTE: For help with the syntax of this file, see:
-~~ http://maven.apache.org/doxia/references/apt-format.html
-
-Maven Plugin Testing Tools
-
- This API is meant to provide a series of convenience tools for developers wishing to test Maven
- plugins. The primary focus of the library is on integration testing, since it is not well-supported
- with current tools and approaches.
-
-* Special Problems with Plugin Integration Testing
-
- Maven plugins represent a somewhat special need in terms of integration testing. Like many
- component-oriented systems, Maven provides much of the runtime context essential for testing a
- plugin in its "natural environment". This means that, in order to properly test the integration of
- any particular plugin into the larger system, the developer should really execute Maven builds
- that test particular features of the plugin in question.
-
- However, running test builds from within the plugin's own build presents some special problems.
- Since we're using Maven to build the Maven plugin, we have to deal with the fact that a previous
- version of the plugin could be active within the current build (not a great practice, but sometimes
- unavoidable). This means that Maven must either be smart enough to unload the existing plugin-version
- from the runtime context and load the newer version - and correspondingly, unload the test version
- and reload the older version for other, later builds in the same reactor. As an alternative, the
- integration-testing of the plugin could fork separate Maven builds, and track the output in order
- to verify results and determine whether the build succeeds. The latter approach, while much slower
- and somewhat dependent on local-system configuration, is currently the most robust way to avoid
- existing versions of the plugin under test.
-
- In addition to plugin-version inconsistencies, integration-testing of Maven plugins must cope with
- the need to cleanup after themselves. Remember, Maven only loads plugins from its own local repository
- (possibly after resolving them from a remote repository). Because of this, the only practical way
- to use the current plugin within an integration-test build is to install it into some sort of local
- repository, then direct Maven to use that local repository for the build. To avoid side effects in
- other builds (remember, we're building Maven plugins here... and they're used to build other projects),
- it's critical to avoid using the main local repository used for normal Maven builds. Therefore,
- plugin integration tests require a custom local repository, to which the integration-testing builds
- can be directed. Further complicating this testing scenario is the fact that the plugin's parent
- POM or one of its ancestor POMs could be a snapshot which has been installed in the main local
- repository, but which is not reachable using the plugin-POM's <<<\<relativePath/\>>>>
- parent-element.<+>
-
- <+ All of this seems to indicate that the best approach for ensuring the presence of all required
- POMs and plugins is to use the normal local repository to construct a new local repository for
- testing purposes. Work on this is ongoing.>
-
- Finally, in order to support integration-testing of plugins, it's important to give the developer
- an API by which to bootstrap the testing environment (and ideally, detect when it's already been
- bootstrapped), and to also provide a robust API for executing builds and verifying results.
-
-* A Note on Test-Suite Maintenance
-
- Since failure to grasp the use cases of any system is a virtual guarantee that it will not meet
- the needs of the user, it's important to understand how integration tests are really used.
-
- First and foremost, integration tests are used as a one-way valve, to ensure that no feature of
- the application - in our case, a Maven plugin - regresses as the result of unrelated development.
- A good set of tests - of which the integration tests are, well, integral - can provide the developer
- with freedom to implement new features with the confidence that he's able to effectively build on
- the foundations of previous versions.
-
- However, it's important to understand that regression-prevention is not the sole purpose of an
- integration test. A secondary but critical use case deals with how integration tests are added to
- the plugin. One has only to consider how bugs are reported on a flawed system to understand. Since
- users usually report bugs, bug reports originate outside of the system. In the case of a Maven
- plugin, this means users are most likely able to supply examples of the failing behavior in the
- form of failing builds. In order to make immediate and direct use of what the user gives us, it's
- critical that integration tests are designed to be augmented using build examples from the user,
- with as little rewriting as possible.
-
- To that end, the approach for integration testing in this library will be the execution of sample
- builds that use the plugin in question, then verify the results, either in the logs, the resulting
- exit code, or the project files it produces.
-
-* Integration-Testing Requirements
-
- To summarize, this library strives to satisfy the following requirements for integration testing
- of Maven plugins:
-
- * Trigger Maven builds using test projects, without incurring any sort of conflict with plugins
- already in use within the current (this plugin's) build.
-
- * Construct a local repository into which the test version of the plugin can be installed,
- allowing the main local repository to remain untouched by the tests. Integration tests can be
- directed to use this test-time local repository instead of the normal location.
-
- * Support tracking and analysis of results from Maven builds spawned during integration testing.
- As far as is reasonable, test builds should be configured in the same way as normal project
- builds, to make the most of test cases submitted by users along with the issues they file.
-
- []
-
-* Utilities Included in this Library
-
- For more information on the APIs described below, see the {{{./apidocs/index.html}JavaDocs}}.
-
- * <<PluginTestTool>> - The main entry point for setting up the plugin-testing environment, this
- utility orchestrates the ProjectTool, RepositoryTool, and BuildTool in order to produce a local
- repository containing the plugin jar, plus any ancestor POM files that are reachable using the
- <<<\<relativePath/\>>>> element of the parent specification.
-
- In order to make test projects more resilient to changes in the plugin's version, this tool
- allows the developer to specify a testing version for the plugin, so any reference to the plugin
- can be unambiguous and avoid accidentally referring to a plugin version resolved from outside.
-
- * <<ProjectTool>> - This testing tool provides APIs for creating a testable plugin jar file,
- optionally skipping the unit tests for the plugin (after all, it's conceivable that the unit
- tests themselves may be using these tools).
-
- * <<RepositoryTool>> - The RepositoryTool provides methods for assembling artifact repositories to
- support testing. This tool is responsible for assembling the local repository that is used
- during integration testing - complete with the test version of the plugin itself, along with all
- of the ancestor POMs that are reachable via <<<\<relativePath/\>>>>.
-
- * <<BuildTool>> - This tool's purpose is fairly self-explanatory; it is used to execute Maven
- builds. It provides a fairly generic API for running builds, for the simple reason that a single
- test may need to run multiple builds. For normal use cases, it's a good idea to wrap the
- BuildTool API using a standard project-testing method that will standardize the options used to
- run a similar set of test builds.
-
- []
diff --git a/maven-plugin-testing-tools/src/site/site.xml b/maven-plugin-testing-tools/src/site/site.xml
deleted file mode 100644
index b6412d5..0000000
--- a/maven-plugin-testing-tools/src/site/site.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
- <body>
- <menu name="Overview">
- <item name="Introduction" href="index.html"/>
- <item name="JavaDocs" href="apidocs/index.html"/>
- <item name="Source Xref" href="xref/index.html"/>
- <!--item name="FAQ" href="faq.html"/-->
- </menu>
- </body>
-</project>
diff --git a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java b/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
deleted file mode 100644
index f7fcb94..0000000
--- a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.util.Collection;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.shared.test.plugin.ProjectTool.PomInfo;
-import org.codehaus.plexus.ContainerConfiguration;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * @version $Id$
- */
-public class ProjectToolTest
- extends PlexusTestCase
-{
-
- private File getPom( String test )
- throws IOException
- {
- File src = new File( "src/test/resources/projects/" + test );
- File dst = new File( "target/unit/projects/" + test );
-
- FileUtils.copyDirectoryStructureIfModified( src, dst );
-
- return new File( dst, "pom.xml" );
- }
-
- public void testManglePomForTesting_ShouldPopulateOutDirAndFinalName()
- throws Exception
- {
- ProjectTool tool = (ProjectTool) lookup( ProjectTool.ROLE, "default" );
-
- File pomFile = getPom( "basic" );
-
- PomInfo info = tool.manglePomForTesting( pomFile, "test", true );
-
- assertEquals( "target"+File.separatorChar+"it-build-target", info.getBuildDirectory() );
- assertEquals( "maven-it-plugin-test.jar", info.getFinalName() );
- assertEquals( "target"+File.separatorChar+"it-build-target"+File.separatorChar+"classes",info.getBuildOutputDirectory() );
- }
-
- public void testPackageProjectArtifact_ShouldPopulateArtifactFileWithJarLocation()
- throws Exception
- {
- ProjectTool tool = (ProjectTool) lookup( ProjectTool.ROLE, "default" );
-
- File pomFile = getPom( "basic" );
-
- MavenProject project = tool.packageProjectArtifact( pomFile, "test", true );
-
- String expectedPath = "target/unit/projects/basic/target/it-build-target/maven-it-plugin-test.jar";
-
- // be nice with windows
- String actualPath = StringUtils.replace( project.getArtifact().getFile().getPath(), "\\", "/" );
-
- assertEquals( expectedPath, actualPath );
- }
-
- public void testPackageProjectArtifact_ShouldPopulateWithCorrectArtifactAndMetadata()
- throws Exception
- {
- ProjectTool tool = (ProjectTool) lookup( ProjectTool.ROLE, "default" );
-
- File pomFile = getPom( "basic" );
-
- MavenProject project = tool.packageProjectArtifact( pomFile, "test", true );
-
- Artifact artifact = project.getArtifact();
-
- assertEquals( "maven-plugin", artifact.getType() );
- assertTrue( "Missing " + artifact.getFile(), artifact.getFile().exists() );
-
- Collection<ArtifactMetadata> metadata = artifact.getMetadataList();
-
- boolean foundPomMetadata = false;
-
- for ( ArtifactMetadata metadataItem : metadata )
- {
- if ( metadataItem instanceof ProjectArtifactMetadata )
- {
- foundPomMetadata = true;
- }
- }
-
- assertTrue( foundPomMetadata );
- }
-
- @Override
- protected void customizeContainerConfiguration(ContainerConfiguration configuration)
- {
- configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
- configuration.setAutoWiring( true );
- }
-}
diff --git a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/RepositoryToolTest.java b/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/RepositoryToolTest.java
deleted file mode 100644
index 85047b2..0000000
--- a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/RepositoryToolTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.maven.shared.test.plugin;
-
-/*
- * 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.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.shared.tools.easymock.TestFileManager;
-import org.codehaus.plexus.ContainerConfiguration;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusTestCase;
-
-/**
- * @version $Id$
- */
-public class RepositoryToolTest
- extends PlexusTestCase
-{
- private TestFileManager fileManager;
-
- public void setUp()
- throws Exception
- {
- super.setUp();
-
- fileManager = new TestFileManager( "RepositoryToolTest.", "" );
- }
-
- public void tearDown()
- throws Exception
- {
- super.tearDown();
-
- fileManager.cleanUp();
- }
-
- public void testCreateLocalRepositoryFromPlugin_ShouldWriteJarAndPom()
- throws Exception
- {
- RepositoryTool repoTool = (RepositoryTool) lookup( RepositoryTool.ROLE, "default" );
-
- File tempDir = fileManager.createTempDir();
-
- String pomContent = "<project><modelVersion>4.0.0</modelVersion></project>";
- String jarContent = "This is a test";
-
- File pom = fileManager.createFile( tempDir, "pom.xml", pomContent );
- File jar = fileManager.createFile( tempDir, "artifact-test.jar", jarContent );
-
- MavenProject pluginProject = new MavenProject();
-
- ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
-
- Artifact pluginArtifact = artifactFactory.createArtifact( "group", "artifact", "test", null, "jar" );
- pluginArtifact.setFile( jar );
- pluginArtifact.addMetadata( new ProjectArtifactMetadata( pluginArtifact, pom ) );
-
- pluginProject.setArtifact( pluginArtifact );
- pluginProject.setFile( pom );
-
- File targetLocalRepoBasedir = fileManager.createTempDir();
-
- repoTool.createLocalRepositoryFromComponentProject( pluginProject, pom, targetLocalRepoBasedir );
-
- fileManager.assertFileExistence( targetLocalRepoBasedir, "group/artifact/test/artifact-test.pom", true );
- fileManager.assertFileContents( targetLocalRepoBasedir, "group/artifact/test/artifact-test.jar", jarContent );
-
- }
-
- @Override
- protected void customizeContainerConfiguration(ContainerConfiguration configuration)
- {
- configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
- configuration.setAutoWiring( true );
- }
-}
diff --git a/maven-plugin-testing-tools/src/test/resources/projects/basic/pom.xml b/maven-plugin-testing-tools/src/test/resources/projects/basic/pom.xml
deleted file mode 100644
index 6ebda69..0000000
--- a/maven-plugin-testing-tools/src/test/resources/projects/basic/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.its.plugins</groupId>
- <artifactId>maven-it-plugin</artifactId>
- <version>2.0-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
-
- <name>Maven IT Plugin</name>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/maven-plugin-testing-tools/src/test/resources/projects/basic/src/main/java/ItMojo.java b/maven-plugin-testing-tools/src/test/resources/projects/basic/src/main/java/ItMojo.java
deleted file mode 100644
index 38bc49f..0000000
--- a/maven-plugin-testing-tools/src/test/resources/projects/basic/src/main/java/ItMojo.java
+++ /dev/null
@@ -1,33 +0,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.
- */
-
-import org.apache.maven.plugin.*;
-
-/**
- * @goal it
- */
-public class ItMojo
- extends AbstractMojo
-{
-
- public void execute()
- {
- }
-
-}
diff --git a/maven-test-tools/pom.xml b/maven-test-tools/pom.xml
index 798fc17..a33ff82 100644
--- a/maven-test-tools/pom.xml
+++ b/maven-test-tools/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing</artifactId>
- <version>3.3.1-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>maven-test-tools</artifactId>
diff --git a/pom.xml b/pom.xml
index 9797c5e..290edb0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing</artifactId>
- <version>3.3.1-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Plugin Testing</name>
@@ -119,7 +119,6 @@
<modules>
<module>maven-plugin-testing-harness</module>
- <module>maven-plugin-testing-tools</module>
<module>maven-test-tools</module>
</modules>