maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chapman Flack (JIRA)" <>
Subject [jira] [Commented] (MANTRUN-207) scriptdef ignores CDATA when there is also an element
Date Fri, 21 Sep 2018 23:06:00 GMT


Chapman Flack commented on MANTRUN-207:

This is pretty straightforward; the code that needs to be fixed is [here|[].]


Note that if there are no children (the 'if' branch) the work of writing is done by writeTag(),
which writes the attributes _and the value_ (which is the script text!). But if any children
exist (for scriptdef, that would be any 'attribute' element or 'element' element), the writing
is done in the 'else' branch, which writes the attributes and the children, but _never writes
the value_! The result is that the written file contains all of the scriptdef configuration
except, well, the script.

That 'else' branch needs a copy of lines 83-87, before it calls endElement().

> scriptdef ignores CDATA when there is also an element
> -----------------------------------------------------
>                 Key: MANTRUN-207
>                 URL:
>             Project: Maven Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8
>         Environment: Windows 10 64bit, java 1.8.0_151, maven 3.5.0
>            Reporter: Matteo Steccolini
>            Priority: Major
>         Attachments: build-main.xml, pom.xml
> When I put a CDATA node inside a scriptdef which has also an element node, the cdata
is ignored. You can see it in the attached build-main.xml that is generated from the attached
pom.xml (mvn antrun:run@hello).
> When I though I might be doing something wrong I wrote this question on stackoverflow:

This message was sent by Atlassian JIRA

View raw message