You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Delany <de...@gmail.com> on 2023/04/04 08:14:39 UTC

empty settings elements in maven 4

Hi there,

When i needed a settings.xml file in the past I would copy the code from
https://maven.apache.org/settings.html
https://maven.apache.org/ref/4.0.0-alpha-5/maven-settings/settings.html

and replace the self-closing tag of whichever section I needed - typically
servers, mirrors and profiles.
The other tags would remain, like "<localRepository/>"

With Maven 3 the empty/self-closing tag was ignored, but in Maven 4 the
value is removed/replaced, resulting in the local repository directory set
to ${pwd}.
This is the case for settings.xml (what about toolchains.xml?) but not
pom.xml

With Maven 4.0.0-alpha-5, and I guess
https://issues.apache.org/jira/browse/MNG-7678
the behaviour has changed back to that of Maven 3 - an empty tag is simply
ignored, it doesn't override.
But while the build is successful, mvn help:effective-settings now fails
with

Execution default-cli of goal
org.apache.maven.plugins:maven-help-plugin:3.4.0:effective-settings failed:
Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getDom()" because
"configuration" is null

Is this now a bug in the help plugin?

Regards,
Delany

Re: empty settings elements in maven 4

Posted by Guillaume Nodet <gn...@apache.org>.
Could you raise a JIRA please ?

Le mar. 4 avr. 2023 à 10:15, Delany <de...@gmail.com> a écrit :

> Hi there,
>
> When i needed a settings.xml file in the past I would copy the code from
> https://maven.apache.org/settings.html
> https://maven.apache.org/ref/4.0.0-alpha-5/maven-settings/settings.html
>
> and replace the self-closing tag of whichever section I needed - typically
> servers, mirrors and profiles.
> The other tags would remain, like "<localRepository/>"
>
> With Maven 3 the empty/self-closing tag was ignored, but in Maven 4 the
> value is removed/replaced, resulting in the local repository directory set
> to ${pwd}.
> This is the case for settings.xml (what about toolchains.xml?) but not
> pom.xml
>
> With Maven 4.0.0-alpha-5, and I guess
> https://issues.apache.org/jira/browse/MNG-7678
> the behaviour has changed back to that of Maven 3 - an empty tag is simply
> ignored, it doesn't override.
> But while the build is successful, mvn help:effective-settings now fails
> with
>
> Execution default-cli of goal
> org.apache.maven.plugins:maven-help-plugin:3.4.0:effective-settings failed:
> Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getDom()" because
> "configuration" is null
>
> Is this now a bug in the help plugin?
>
> Regards,
> Delany
>


-- 
------------------------
Guillaume Nodet