maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herve Boutemy (Jira)" <j...@apache.org>
Subject [jira] [Updated] (MNG-6952) Fail fast if pom cannot be transformed
Date Sat, 03 Apr 2021 15:21:00 GMT

     [ https://issues.apache.org/jira/browse/MNG-6952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Herve Boutemy updated MNG-6952:
-------------------------------
    Fix Version/s:     (was: to be fixed before release)
                   4.0.0-alpha-1
                   4.0.0

> Fail fast if pom cannot be transformed
> --------------------------------------
>
>                 Key: MNG-6952
>                 URL: https://issues.apache.org/jira/browse/MNG-6952
>             Project: Maven
>          Issue Type: Bug
>          Components: POM
>    Affects Versions: 4.0.0
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 4.0.0, 4.0.0-alpha-1
>
>
> {{maven-antrun-plugin\target\it\attach-artifact-test-with-prefix}} fails with the build/consumer.
> The pom contains this:
> {code:xml}
>             <configuration>
>               <customTaskPrefix>mvn</customTaskPrefix>
>               <target>
>                 <mvn:attachartifact file="test.txt" classifier="cl" />
>               </target>
>             </configuration>
> {code}
> And fails during {{install:install}} with 
> {noformat}
> org.xml.sax.SAXParseException; lineNumber: 44; columnNumber: 71; The prefix "mvn" for
element "mvn:attachartifact" is not bound.
> {noformat}
> It is fine that Maven complains about invalid XML, but during install is too late.
> It should happen not at all, or already while making the buildplan.
> If inheritence of such configuration still works, I'd prefer to break the build early.
> The proper fix is to make it valid XML, by specifying the namespace like this:
> {code:xml}
>             <configuration xmlns:mvn="maven.apache.org/antrun">
>               <customTaskPrefix>mvn</customTaskPrefix>
>               <target>
>                 <mvn:attachartifact file="test.txt" classifier="cl" />
>               </target>
>             </configuration>
> {code}
> This already works (even with Maven 3.0), and ideally maven-antrun-plugin also provides
an XSD, so it can be validated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message