there is a convention for Maven POMs: [1] "in the wild", since Maven defines its POM model with Modello, the order defined in maven.mdo is the order naturally used when writing POMs using MavenXpp3Writer: see the descriptor reference [2] and MavenXpp3Writer javadoc [3] maven.mdo was modified in the past to have an order similar to the Maven convention, but there are still a few differences
I don't know any plugin to enforce an order on elements: if you accept to loose comments, it should be straightforward with MavenXpp3Writer. But if you want to preserve comments, the hard work starts... :) HTH Hervé [1] http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention [2] http://maven.apache.org/ref/2.2.1/maven-model/maven.html [3] http://maven.apache.org/ref/2.2.1/maven-model/apidocs/org/apache/maven/model/io/xpp3/MavenXpp3Writer.html ----- Mail Original ----- De: "Stephen Connolly" <[email protected]> À: "Maven Users List" <[email protected]> Envoyé: Dimanche 27 Décembre 2009 12h11:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: Canonical order of POM elements? there is a defined order for projects with groupId matching org.apache.maven.* I cannot recall exactly what that order is though 2009/12/27 Paul Benedict <[email protected]> > Has Maven ever produced a plugin to canonically order (rewrite) an > existing POM (and respecting whitespace)? Validating against an XSD, > I know element order doesn't matter -- but it would be nice if there > was a way to uniformly order my POM. No such order apparently exists > in the wild. > > Paul > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
