mirror of https://github.com/apache/maven.git
MNG-3997: If one ModelProperty property URI starts with another ModelProperty URI and both are empty and both are consecutive in the pom, then the first tag was not being closed on unmarshalling to XML.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@736541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
15f10579d7
commit
496d8ffcb4
|
@ -390,7 +390,8 @@ public class PomTransformer
|
|||
{
|
||||
int index = props.indexOf(mp) + 1;
|
||||
|
||||
if(index <= props.size() && mp.isParentOf(props.get(index)) && !props.get(index).getUri().contains("#property"))
|
||||
if(index <= props.size() && mp.isParentOf(props.get(index)) && mp.getDepth() != props.get(index).getDepth()
|
||||
&& !props.get(index).getUri().contains("#property"))
|
||||
{
|
||||
p.add(new ModelProperty(mp.getUri(), null));
|
||||
}
|
||||
|
|
|
@ -122,6 +122,15 @@ public class PomConstructionTest
|
|||
// System.out.println(pom.getDomainModel().asString());
|
||||
assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() );
|
||||
}
|
||||
|
||||
/** MNG-3997 */
|
||||
public void testConsecutiveEmptyElements()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "consecutive_empty_elements" );
|
||||
pom.getDomainModel().asString();
|
||||
}
|
||||
|
||||
//*/
|
||||
public void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement()
|
||||
throws Exception
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>test</groupId>
|
||||
<artifactId>artifact</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<organization/>
|
||||
<organizationUrl/>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue