prevent write files in scm tree during tests

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/branches/MPLUGIN-189@1337277 13f79535-47bb-0310-9956-ffa450edef68
master
Olivier Lamy 2012-05-11 16:46:01 +00:00
parent 2eef7a412b
commit 73885abdbc
2 changed files with 22 additions and 0 deletions

View File

@ -76,4 +76,18 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<filePath>${project.build.directory}</filePath>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -20,6 +20,7 @@ package org.apache.maven.tools.plugin.extractor.java;
*/
import junit.framework.TestCase;
import org.apache.maven.model.Build;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.Parameter;
@ -77,6 +78,13 @@ public class JavaMojoDescriptorExtractorTest
model.setArtifactId( "maven-unitTesting-plugin" );
MavenProject project = new MavenProject( model );
project.setBuild( new Build(){
@Override
public String getOutputDirectory()
{
return System.getProperty( "filePath" );
}
});
project.setFile( new File( root, "pom.xml" ) );
project.addCompileSourceRoot( new File( root, directory ).getPath() );