I have a maven-multi project when I create a new eclipse project from it (according to M2E 1.0 "Checkout Maven Project from SCM). I want the eclipse checkstyle plugin to be configured for this project automatically.
So, I added the maven-eclipse-plugin
section to the parent pom <pluginManagement>
and configured it to create the .checkstyle
file, as well as the additional character of the CheckstyleNature
project. In modul poms, I added the name maven-eclipse-plugin
in the build section. But when I check the project, nothing happens, the file is not generated and nature is not added.
So, I think I'm doing something completely wrong, but how is this done right?
Pom Pom Plugin Management Section:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.8</version> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>false</downloadJavadocs> <wtpversion>2.0</wtpversion> <additionalBuildcommands> <buildCommand> <name>org.eclipse.ajdt.core.ajbuilder</name> <arguments> <aspectPath>org.springframework.aspects</aspectPath> </arguments> </buildCommand> <buildCommand> <name>org.springframework.ide.eclipse.core.springbuilder</name> </buildCommand> </additionalBuildcommands> <additionalProjectnatures> <projectnature>org.eclipse.ajdt.ui.ajnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</projectnature> </additionalProjectnatures> <additionalConfig> <file> <name>.checkstyle</name> <content> <![CDATA[ <?xml version="1.0" encoding="UTF-8"?> <fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> <fileset name="all" enabled="true" check-config-name="My Checkstyle rules" local="false"> <file-match-pattern match-pattern="." include-pattern="true"/> </fileset> <filter name="FilesFromPackage" enabled="true"> <filter-data value="target" /> <filter-data value="src/main/resources"/> <filter-data value="src/test/java"/> <filter-data value="src/test/resources"/> <filter-data value="src/main/webapp" /> </filter> </fileset-config> ]]> </content> </file> </additionalConfig> </configuration> </plugin>
Pom module - plugins:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> </plugin>
Ralph
source share