Skip to content

jamestyrrell/xml-formatter

 
 

Repository files navigation

Maven XML Formatter Plugin

This is a fork of the original Maven xml-formatter plugin. This fork ensures the plugin will not overwrite original files unless an actual change has occurred.

You do not need to clone this GitHub repository to use the fork. You can use it immediately by making two simple changes to your project's pom.xml.

First, declare this project as a plugin repository:

<pluginRepositories>
  <pluginRepository>
    <id>maven-xml-formatter-plugin</id>
    <name>Maven2 XML Formatter Plugin repository</name>
    <url>https://raw.github.com/benalexau/xml-formatter/master/releases/</url>
  </pluginRepository>
</pluginRepositories>

Second, enable the plugin. Example configuration settings are shown below which will cause reformatting any time a test is run, but of course you can attach it to any lifecycle phase. Please refer to the original documentation for more configuration options.

<plugin>
    <groupId>org.technicalsoftwareconfigurationmanagement.maven-plugin</groupId>
    <artifactId>tscm-maven-plugin</artifactId>
    <version>2.1.0.20111230154050</version>
    <configuration>
        <includes>
            <include>**/*.xml</include>
        </includes>
        <excludes>
            <exclude>**/target/**</exclude>
            <exclude>checkstyle-config.xml</exclude>
            <exclude>**/OSGI-INF/**</exclude>
            <exclude>**/.idea/**</exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <phase>test</phase>
            <goals>
                <goal>xmlFormatter</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Ticket 2 has been logged against the original project so they can incorporate these changes. As such, please check the ticket for updates before using this fork.

About

Fork of http://code.google.com/p/xml-formatter/ with enhancements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%