Fork me on GitHub

Load Coding Styles into Workspace

External coding style file can be loaded into your Eclipse workspace via a URL.

The following example shows how set Maven code style format to a workspace under your current directory.

mvn eclipse:eclipse -Declipse.projectDir=. 
    -Declipse.workspaceCodeStyleURL=http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/optional/eclipse-config/maven-styles.xml 
    

or in your pom.xml:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.12.1</version>
        <configuration>
          <workspace>${basedir}</workspace>
          <workspaceCodeStylesURL>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/optional/eclipse-config/maven-styles.xml</workspaceCodeStylesURL>
        </configuration>
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>