Skip to content

veithen/eclipse-settings-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eclipse-settings-maven-plugin

Applies per-project Eclipse settings to Maven projects. The most common use cases is to configure the Java code formatter to conform to the code style in use in the project.

There are two key differences with other similarly named Maven plugins:

  • The plugin sets individual properties instead of replacing entire preference files. This is important for the org.eclipse.jdt.core bundle because its preferences contain compiler settings as well as the code formatter configuration. The compiler settings are generated by M2E based on the maven-compiler-plugin configuration. They must not be overwritten when applying code formatter settings.

  • The settings are configured directly in the POM (typically in a parent POM) instead of a separate settings JAR.

Usage

<plugin>
    <groupId>com.github.veithen.maven</groupId>
    <artifactId>eclipse-settings-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>apply</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <bundles>
            <bundle>
                <symbolicName>org.eclipse.jdt.core</symbolicName>
                <properties>
                    <property>
                        <name>org.eclipse.jdt.core.formatter.comment.line_length</name>
                        <value>100</value>
                    </property>
                    <property>
                        <name>org.eclipse.jdt.core.formatter.lineSplit</name>
                        <value>100</value>
                    </property>
                    <property>
                        <name>org.eclipse.jdt.core.formatter.tabulation.char</name>
                        <value>space</value>
                    </property>
                    <property>
                        <name>org.eclipse.jdt.core.formatter.indentation.size</name>
                        <value>4</value>
                    </property>
                </properties>
            </bundle>
        </bundles>
    </configuration>
</plugin>

About

Applies Eclipse settings for Maven projects

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages