mirror of https://github.com/apache/maven.git
[MNG-6700] Equal compile source roots are added multiple times
This closes #266
This commit is contained in:
parent
8da81ce73c
commit
84bf1877f0
|
@ -304,6 +304,10 @@ public class MavenProject
|
|||
{
|
||||
path = file.getAbsolutePath();
|
||||
}
|
||||
else if ( ".".equals( path ) )
|
||||
{
|
||||
path = getBasedir().getAbsolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
path = new File( getBasedir(), path ).getAbsolutePath();
|
||||
|
|
|
@ -198,6 +198,19 @@ public class MavenProjectTest
|
|||
assertNoNulls( p.getTestClasspathElements() );
|
||||
}
|
||||
|
||||
public void testAddDotFile()
|
||||
{
|
||||
MavenProject project = new MavenProject();
|
||||
|
||||
File basedir = new File( System.getProperty( "java.io.tmpdir" ) );
|
||||
project.setFile( new File( basedir, "file" ) );
|
||||
|
||||
project.addCompileSourceRoot( basedir.getAbsolutePath() );
|
||||
project.addCompileSourceRoot( "." );
|
||||
|
||||
assertEquals( 1, project.getCompileSourceRoots().size() );
|
||||
}
|
||||
|
||||
private void assertNoNulls( List<String> elements )
|
||||
{
|
||||
assertFalse( elements.contains( null ) );
|
||||
|
|
Loading…
Reference in New Issue