mirror of https://github.com/apache/maven.git
o Extended IT plugin to allow distinction of multiple executions
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@992668 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78debe8e47
commit
5e7d4e0821
|
@ -333,6 +333,12 @@ public abstract class AbstractDependencyMojo
|
|||
|
||||
if ( pathname != null )
|
||||
{
|
||||
if ( pathname.indexOf( "@idx@" ) >= 0 )
|
||||
{
|
||||
// helps to distinguished forked executions of the same mojo
|
||||
pathname = pathname.replaceAll( "@idx@", String.valueOf( nextCounter() ) );
|
||||
}
|
||||
|
||||
file = new File( pathname );
|
||||
|
||||
if ( !file.isAbsolute() )
|
||||
|
@ -344,4 +350,19 @@ public abstract class AbstractDependencyMojo
|
|||
return file;
|
||||
}
|
||||
|
||||
private int nextCounter()
|
||||
{
|
||||
int counter = 0;
|
||||
|
||||
String key = getClass().getName();
|
||||
|
||||
synchronized ( System.class )
|
||||
{
|
||||
counter = Integer.getInteger( key, 0 ).intValue();
|
||||
System.setProperty( key, Integer.toString( counter + 1 ) );
|
||||
}
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,9 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
|||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
/**
|
||||
* Creates text files that list the dependencies with scope compile in the order returned from the Maven core.
|
||||
* Creates text files that list the dependencies with scope compile in the order returned from the Maven core. The path
|
||||
* parameters of this mojo support the token <code>@idx@</code> to dynamically insert a running index in order
|
||||
* to distinguish multiple executions of the same mojo.
|
||||
*
|
||||
* @goal compile
|
||||
* @requiresDependencyResolution compile
|
||||
|
|
|
@ -24,7 +24,8 @@ import org.apache.maven.plugin.MojoExecutionException;
|
|||
|
||||
/**
|
||||
* Creates text files that list the dependencies with scope compile and runtime in the order returned from the Maven
|
||||
* core.
|
||||
* core. The path parameters of this mojo support the token <code>@idx@</code> to dynamically insert a running
|
||||
* index in order to distinguish multiple executions of the same mojo.
|
||||
*
|
||||
* @goal compile-runtime
|
||||
* @requiresDependencyResolution compile+runtime
|
||||
|
|
|
@ -23,7 +23,9 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
|||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
/**
|
||||
* Creates text files that list the dependencies with scope runtime in the order returned from the Maven core.
|
||||
* Creates text files that list the dependencies with scope runtime in the order returned from the Maven core. The path
|
||||
* parameters of this mojo support the token <code>@idx@</code> to dynamically insert a running index in order
|
||||
* to distinguish multiple executions of the same mojo.
|
||||
*
|
||||
* @goal runtime
|
||||
* @requiresDependencyResolution runtime
|
||||
|
|
|
@ -23,7 +23,9 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
|||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
/**
|
||||
* Creates text files that list the dependencies with scope test in the order returned from the Maven core.
|
||||
* Creates text files that list the dependencies with scope test in the order returned from the Maven core. The path
|
||||
* parameters of this mojo support the token <code>@idx@</code> to dynamically insert a running index in order
|
||||
* to distinguish multiple executions of the same mojo.
|
||||
*
|
||||
* @goal test
|
||||
* @requiresDependencyResolution test
|
||||
|
|
Loading…
Reference in New Issue