Re: Comments removed in consumer POM

2025-02-11 Thread Guillaume Nodet
Le mar. 11 févr. 2025 à 12:17, Thomas Reinhardt a écrit : > > Maybe this is unrelated, but I had problems with regard to xml comments > in custom maven plugins in the past. Some of our in-house plugins > rewrite poms and it is always a challenge to preserve existing comments. > I know there is a

Re: Comments removed in consumer POM

2025-02-11 Thread Thomas Reinhardt
Maybe this is unrelated, but I had problems with regard to xml comments in custom maven plugins in the past. Some of our in-house plugins rewrite poms and it is always a challenge to preserve existing comments. I know there is a (partial?) solution that the release plugin uses but that is ha

Re: Comments removed in consumer POM

2025-02-10 Thread Romain Manni-Bucau
Le mar. 11 févr. 2025 à 07:32, Guillaume Nodet a écrit : > I think this discussion tends to go away from two important points. > > First, consumer poms NEED to be able to be read by Maven 3. > So you cannot really add any custom namespace, new elements or > anything that would be rejected by Mave

Re: Comments removed in consumer POM

2025-02-10 Thread Guillaume Nodet
I think this discussion tends to go away from two important points. First, consumer poms NEED to be able to be read by Maven 3. So you cannot really add any custom namespace, new elements or anything that would be rejected by Maven 3. You can force the use of a modelVersion > 4.0.0 in the consume

Re: Comments removed in consumer POM

2025-02-10 Thread Elliotte Rusty Harold
On Mon, Feb 10, 2025 at 1:15 PM Xeno Amess wrote: > > well, adding custom elements, makes it cannot pass xsd, right? Depends on what the XSD says. Not that satisfying the XSD is or should be a requirement. > or we shall allow any element name? but that would kill typo check, like if > somebody w

Re: Comments removed in consumer POM

2025-02-10 Thread Romain Manni-Bucau
Maybe we can start by just keeping the comments before or nested in kept element and if the comment is before a dropped element (build) we drop it as well? Will not reach 100% but maybe be sufficient to start? Romain Manni-Bucau @rmannibucau | .NET Blog

Re: Comments removed in consumer POM

2025-02-10 Thread Xeno Amess
> And if you ask for my own idea, I would tend to preserve the comments, until there be better solution but sadly I just think in the shitty xml/xsd world, there might never be a better solution.. Xeno Amess 于2025年2月10日周一 21:45写道: > > Side note: technically this doesn't help to move content

Re: Comments removed in consumer POM

2025-02-10 Thread Xeno Amess
> Side note: technically this doesn't help to move content to tags since we have the info of comment location and content already, what we miss is "should we keep it or not" and this is the same for custom xsds - being worse for XSD when they are nested in kept elements so the other topic about cus

Re: Comments removed in consumer POM

2025-02-10 Thread Romain Manni-Bucau
Are we saying comments should be written in tags? I think we are starting to speak about another topic - which is relevant and mainly "how can we handle external XSD securely" - but comment topic stays, as mentionned there are real life use cases for comments where you do not want to go with a cust

Re: Comments removed in consumer POM

2025-02-10 Thread Xeno Amess
well, adding custom elements, makes it cannot pass xsd, right? or we shall allow any element name? but that would kill typo check, like if somebody wrongly said, , and spend a whole day finding what be wrong. or is there some way to allow some...prefix?or allow-all-namespace like or something? Ga

Re: Comments removed in consumer POM

2025-02-10 Thread Gary Gregory
I agree FWIW, this is a problem XML standards solved decades ago. Comments should be considered invisible, in fact many parsers don't surface them. Between processing instructions and namespaces, a tool should have all it needs IMO. Gary On Mon, Feb 10, 2025, 07:45 Elliotte Rusty Harold wrote:

Re: Comments removed in consumer POM

2025-02-10 Thread Elliotte Rusty Harold
On Mon, Feb 10, 2025 at 10:02 AM Xeno Amess wrote: > > > Sometimes comments are used to embed additional machine-readable metadata. > yes and considering somebody would like to use this for a maven extension > or something... Yes, that's a pretty common antipattern. Embedding other markup formats

Re: Comments removed in consumer POM

2025-02-10 Thread Xeno Amess
> Sometimes comments are used to embed additional machine-readable metadata. yes and considering somebody would like to use this for a maven extension or something... Julien Plissonneau Duquène 于2025年2月10日周一 16:47写道: > Hi, > > Le 2025-02-09 20:28, Anders Hammar a écrit : > > After the talk we we

Re: Comments removed in consumer POM

2025-02-10 Thread Julien Plissonneau Duquène
Hi, Le 2025-02-09 20:28, Anders Hammar a écrit : After the talk we were approached by a couple of people from the audience who raised concern about comments in the build POM being removed in the published consumer POM. Sometimes comments are used to embed additional machine-readable metadata

Re: Comments removed in consumer POM

2025-02-09 Thread Guillaume Nodet
In case someone is looking at where the consumer POM is written, the code is here: https://github.com/apache/maven/blob/bcf5c0c4e0b6d6c53c6a07d3bf10794b0e6083a1/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java#L191 Le lun. 10 fé

Re: Comments removed in consumer POM

2025-02-09 Thread Manfred Moser
I agree with idea of keeping comments. In fact I think it might be best to somehow select for each comment section to be part of the consumer pom or not. Not sure how to achieve that cleanly though Manfred On 2025-02-09 11:28 a.m., Anders Hammar wrote: Hi, I and Robert did a Maven 4 presen

Re: Comments removed in consumer POM

2025-02-09 Thread Romain Manni-Bucau
Strictly speaking it is in the xml tree ( https://maven.apache.org/pom.html#Licenses) but comments are often very useful, a common one we likely do not want to loose is why a dep was overriden or excluded. Indeed we can always add a tag but it will end up having with a 0-n cardinality which is not

Re: Comments removed in consumer POM

2025-02-09 Thread Elliotte Rusty Harold
If the consumer pom is published at a public URL, a copyright notice is reasonable. How the file was created or edited doesn't really enter into it. Now that I think about it though, why do we have to use a comment for the copyright notice? This feels like something we should have as an element in

Re: Comments removed in consumer POM

2025-02-09 Thread Romain Manni-Bucau
Hi Anders, Not sure it can really be problematic until it is considered as sources - and it is not. But 100% agree it can be neat to keep it at some point but then it means flagging them as "keepable" to not keep the comment on build block which will be stripped for example. Romain Manni-Bucau @r

Comments removed in consumer POM

2025-02-09 Thread Anders Hammar
Hi, I and Robert did a Maven 4 presentation at Jfokus here in Sweden earlier this week. One of the main topics was of course build/consumer POM. After the talk we were approached by a couple of people from the audience who raised concern about comments in the build POM being removed in the publish