You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/11/04 07:37:00 UTC

[jira] [Commented] (MNG-7589) MavenXpp3Writer write empty property with self-closing tag?

    [ https://issues.apache.org/jira/browse/MNG-7589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17628744#comment-17628744 ] 

Michael Osipov commented on MNG-7589:
-------------------------------------

The writer is auto generated. You need to look into Codehaus Modello. This component decides about this.

> MavenXpp3Writer write empty property with self-closing tag?
> -----------------------------------------------------------
>
>                 Key: MNG-7589
>                 URL: https://issues.apache.org/jira/browse/MNG-7589
>             Project: Maven
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 3.8.6
>         Environment: Maven 3.8.6
>            Reporter: Jeff Thomas
>            Priority: Trivial
>
> I am using a maven-plugin which manipulates the POM and writes a new POM model.  (similar to 'maven-git-versioning-extension' or 'flatten-maven-plugin').
> When writing a POM using the MavenXpp3Writer a property without a value is written out as follows:
>  
> {code:java}
> <project>
>   <properties>
>     <some.property></some.property>
>   </properties>
> </project>
> {code}
>  
> Would it be possible to write this out with a self-closing tag? Or provide an option to the writer to do so?
>  
> {code:java}
> <project>
>   <properties>
>     <some.property/>
>   </properties>
> </project> {code}
> Its just eye-candy but the IDE (IntelliJ) displays warnings for empty tags and I don't want to disable the check globally. :)
>  
> Why empty properties?
> For some plugins we use empty properties as placeholders which child projects or sub-modules can override.  For example: maven-surefire-plugin `argLine`.  This prevents other IDE errors for missing properties when editing the POM.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)