mirror of https://github.com/apache/maven.git
[MNG-5380] check that whitespace can be preserved in Maven plugin configuration when building MavenProject (still need to check if content is not trimmed when injected into plugin)
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1412310 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
784e8c3a90
commit
b5eee08e3f
|
@ -1083,9 +1083,10 @@ public class PomConstructionTest
|
||||||
{
|
{
|
||||||
PomTestWrapper pom = buildPom( "reporting-plugin-config/sub" );
|
PomTestWrapper pom = buildPom( "reporting-plugin-config/sub" );
|
||||||
|
|
||||||
assertEquals( 2, ( (List<?>) pom.getValue( "reporting/plugins[1]/configuration/stringParams" ) ).size() );
|
assertEquals( 3, ( (List<?>) pom.getValue( "reporting/plugins[1]/configuration/stringParams" ) ).size() );
|
||||||
assertEquals( "parentParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[1]" ) );
|
assertEquals( "parentParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[1]" ) );
|
||||||
assertEquals( "childParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[2]" ) );
|
assertEquals( "childParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[2]" ) );
|
||||||
|
assertEquals( " preserve space ", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[3]" ) );
|
||||||
assertEquals( "true", pom.getValue( "reporting/plugins[1]/configuration/booleanParam" ) );
|
assertEquals( "true", pom.getValue( "reporting/plugins[1]/configuration/booleanParam" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,14 +78,14 @@ class Xpp3DomNodePointer
|
||||||
@Override
|
@Override
|
||||||
public Object getValue()
|
public Object getValue()
|
||||||
{
|
{
|
||||||
return getValue(node);
|
return getValue( node );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object getValue( Xpp3Dom node )
|
private static Object getValue( Xpp3Dom node )
|
||||||
{
|
{
|
||||||
if ( node.getValue() != null )
|
if ( node.getValue() != null )
|
||||||
{
|
{
|
||||||
return node.getValue().trim();
|
return node.getValue();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,8 +36,9 @@
|
||||||
<artifactId>maven-it-plugin-configuration</artifactId>
|
<artifactId>maven-it-plugin-configuration</artifactId>
|
||||||
<version>2.1-SNAPSHOT</version>
|
<version>2.1-SNAPSHOT</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<stringParams combine.children="append">
|
<stringParams combine.children="append">
|
||||||
<stringParam>childParam</stringParam>
|
<stringParam> childParam </stringParam>
|
||||||
|
<stringParam xml:space="preserve"> preserve space </stringParam>
|
||||||
</stringParams>
|
</stringParams>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
Loading…
Reference in New Issue