Issue Type: Bug Bug
Affects Versions: tidy-maven-plugin-1.0-alpha-2
Assignee: Unassigned
Components: tidy
Created: 19/Dec/13 11:27 AM
Description:

If a POM is not consistent with leading tabs vs. leading spaces, tidy-m-p hoses the formatting:

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

  <groupId>foo.bar</groupId>
  <artifactId>hello-world</artifactId>
  <version>0.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <properties>
    <foo>bar</foo>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tidy-maven-plugin</artifactId>
        <version>1.0-alpha-2</version>
      </plugin>
    </plugins>
  </build>

</project>

And the diff:

diff --git a/pom.xml b/pom.xml
index a20ef2e..190970a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>

-  <groupId>foo.bar</groupId>
-  <artifactId>hello-world</artifactId>
-  <version>0.1.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
+ <groupId>foo.bar</groupId>
+ <artifactId>hello-world</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>

-  <properties>
+ <properties>
     <foo>bar</foo>
   </properties>

-  <build>
+ <build>
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>

I know that in general, such cases are rather nasty to deal with, but I think for tidy-m-p to be useful in practice, it needs to address exactly such situations. That is, people are going to want to throw stapled together POMs at it and ideally have it transformed into something beautiful.

Project: Mojo
Priority: Major Major
Reporter: Curtis Rueden
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to