Tôi có một dự án maven-multi, khi tôi tạo một dự án nhật thực mới từ nó (bằng M2E 1.0 "Dự án Maven thanh toán từ SCM) Tôi muốn plugin eclipse checkstyle là cấu hình cho dự án mà tự động.Cách cấu hình Checkstyle trong Eclipse cho dự án maven tự động
vì vậy, tôi thêm maven-eclipse-plugin
trong phần mẹ pom của <pluginManagement>
và cấu hình nó để tạo ra .checkstyle
tập tin cũng như các dự án thêm chất CheckstyleNature
. trong poms modul tôi đã thêm tên của maven-eclipse-plugin
trong xây dựng Nhưng khi tôi kiểm tra dự án không có gì happend, tập tin không được tạo ra và bản chất không được thêm vào.
Vì vậy, tôi nghĩ rằng tôi đang làm điều gì đó hoàn toàn sai, nhưng làm thế nào nó được thực hiện đúng?
Chánh pom - phần quản lý plugin:
<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>
Mô-đun pom - plugins phần:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
</plugin>
âm thanh rất tốt, tôi chưa thử nghiệm, nhưng fron mô tả projekt nó là những gì tôi cần – Ralph
Thật không may, [m2e-mã chất lượng kết nối không có trong danh mục của m2e 1.4 (Kepler)] (https: // github.com/m2e-code-quality/m2e-code-quality/issues/25). – oberlies
trang chủ m2e-code-chất lượng (http://m2e-code-quality.github.io/m2e-code-quality/) đường nối khá cũ, nhưng trang thị trường của nó https: //marketplace.eclipse. chất lượng org/content/m2e-code cho thấy dự án vẫn còn sống – Ralph