You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Beelen, M. - SPLXL" <Ma...@klm.com> on 2007/08/13 17:31:38 UTC

Formatting of generated pom.xml

Hello all,
 
After using maven2 for quite some while now, I started development of my
first own archetype today.
I'm quite pleased about the progress I've been able to make!
 
There is one issue I'm not quite satisfied about yet, so I hope someone
can give me some pointers about how to solve this.
 
 
I have written a simple archtype with a prototype pom.xml:
 
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0
<http://maven.apache.org/POM/4.0.0> "
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> "
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
<http://maven.apache.org/POM/4.0.0>
http://maven.apache.org/maven-v4_0_0.xsd
<http://maven.apache.org/maven-v4_0_0.xsd> ">
 
 <modelVersion>4.0.0</modelVersion>
 
 <groupId>${groupId}</groupId>
 <artifactId>${artifactId}</artifactId>
 
 <packaging>war</packaging>
 
 <name>YourSpringMVCBasedPortlet</name>
 <description>
  
 </description>
 
 <dependencies>
  <dependency>
   <groupId>com.klm.commercial.portlet.common</groupId>
   <artifactId>SpringMVCPortlet</artifactId>
   <version>2.0.6</version>
  </dependency>
 </dependencies>
 
</project>
 
After generating a new project with mvn archetype:create the generated
pom.xml look like this:
 
<?xml version="1.0" encoding="UTF-8"?><project>
  <parent>
    <artifactId>Portlets</artifactId>
    <groupId>com.klm.commercial.afklbiz.portlets</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.klm.commercial.afklbiz.portlets</groupId>
  <artifactId>TaAdministrationPortlet</artifactId>
  <packaging>war</packaging>
  <name>YourSpringMVCBasedPortlet</name>
  <description></description>
  <dependencies>
    <dependency>
      <groupId>com.klm.commercial.portlet.common</groupId>
      <artifactId>SpringMVCPortlet</artifactId>
      <version>2.0.6</version>
    </dependency>
  </dependencies>
</project>
 
The file contains the proper content, but all formatting is being lost.
I can live with that, but what bothers me more is that the xmlns-schema
information is being lost in the generation.
I want my pom.xml to contain proper xml-schema information in order to
have proper content assistence working while editing the generated
pom.xml.
 
What causes that information to be lost?
Is it possible to change the way the archetype:creat-plugin, so that it
respectfully handles the provided pom.xml?
Or: Shouldn't the generated pom.xml get the proper schema information by
default?
 
Any hint on how to get this working according to my wishes are greatly
appreciated!
 
With kind regards,
    Marco Beelen