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

When an XML comment exists outside one of Maven's toplevel elements (e.g., <properties>), the surrounding whitespace is removed by "tidy:pom".

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>

  <!-- Hello world -->
  <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>

After running "mvn tidy:pom":

Unable to find source-code formatter for language: diff. Available languages are: actionscript, html, java, _javascript_, none, sql, xhtml, xml
diff --git a/pom.xml b/pom.xml
index 20226bc..e01edd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,8 +6,7 @@
   <artifactId>hello-world</artifactId>
   <version>0.1.0-SNAPSHOT</version>
   <packaging>pom</packaging>
-
-  <!-- Hello world -->
+<!-- Hello world -->
   <properties>
     <foo>bar</foo>
   </properties>

Not sure whether this is worth fixing (you can simply move the XML comment inside the relevant section instead), but reporting for completeness.

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