mirror of https://github.com/apache/maven.git
normalize file separator characters.
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@675445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9284388b70
commit
d61c2202d7
|
@ -32,7 +32,7 @@ public class PropertyInterpolationMojo
|
|||
extends AbstractMojo
|
||||
{
|
||||
|
||||
private static final String FS = File.separator;
|
||||
private static final char FS = File.separatorChar;
|
||||
|
||||
/** @parameter */
|
||||
private String myDirectory;
|
||||
|
@ -43,8 +43,12 @@ public class PropertyInterpolationMojo
|
|||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
String value = project.getProperties().getProperty( "myDirectory" );
|
||||
if ( !value.equals( project.getBuild().getDirectory() + FS + "foo" ) )
|
||||
String value = project.getProperties().getProperty( "myDirectory" ).replace( '/', FS ).replace( '\\', FS );
|
||||
|
||||
String targetValue = project.getBuild().getDirectory() + FS + "foo";
|
||||
targetValue = targetValue.replace( '/', FS).replace( '\\', FS );
|
||||
|
||||
if ( !value.equals( targetValue ) )
|
||||
{
|
||||
throw new MojoExecutionException( "Property value of 'myDirectory': " + value + " should equal project build directory: " + project.getBuild().getDirectory() + " + '/foo'" );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue