release-engineering / pom-version-manipulator

Align versions in Maven POMs with those found in a Bill-of-Materials POM
Other
11 stars 9 forks source link

Vman removes empty properties #72

Closed rnc closed 11 years ago

rnc commented 11 years ago

If a property is defined as e.g.

(so the default value is 'blank' and if profile X is activated then it is defined to have a value). However it appears VMan removes this default blank property. A workaround would be to patch it with a dummy value e.g. -DDUMMY

jdcasey commented 11 years ago

Using NOT_SET for things like causes breakage. Need to find a way to preserve the empty element.

The problem is in the jdom model writer, I think. That project should be at:

http://github.com/jdcasey/maven-model-jdom-support

rnc commented 11 years ago

Possibly the issue might be coming from maven-model-jdom-support3.0.x-1.1.jar ( commonjava) and in the WriterUtils. In there it seems to do findAndReplace on elements. In the findAndReplaceSimpleElement method it does a check if the element shouldExist - if the text is not null and if its length > 0. I don't think this handles the scenario where the element is a property but of length zero. If it is zero then it ends up removing the element from the parent.