我正在使用Maven,Maven checkstyle插件,Jenkins和Jenkins checkstyle插件。Checkstyle在Maven工作,但不在Jenkins工作
我總共有7個項目。 1個家長和6個兒童項目。
我有以下3種情況:
的Checkstyle報告所有project.n父POM我宣佈標籤的CheckStyle插件:
我跑
mvn clean site
命令它在eclipse中與maven一起工作。並在詹金斯也。
爲所有7個項目提供checkstyle報告。
除2個項目外的所有項目的Checkstyle報告。
我在父POM刪除一部分,我加入
我在剩下的4個項目加入,我宣佈標籤的CheckStyle插件。
它在eclipse中工作,但不在Jenkins中工作。
請給出解決方案
我的代碼:
<reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.10</version> <configuration> <configLocation>../parent-project/checkstyle.xml</configLocation> </configuration> </plugin> </plugins>
3.
- 我刪除的CheckStyle插件在父
- 我添加了與上面的代碼相同的4個需要項目中的checkstyle插件。
在剩下的2個孩子項目中,我加入了這個。
<reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.10</version> <configuration> <skip>true</skip> </configuration> </plugin> </plugins>
我運行 '命令mvn乾淨的網站'
- 它在Maven的工作如預期,但在詹金斯不工作。
我在'Jenkins'中不工作的意思是我在Jenkins中安裝了checkstyle插件,在Jenkins工作中我選中了'Publish Checkstyle analysis results'複選框。在場景1中,我能夠在jenkins作業頁面中看到checkstyle鏈接。如果我點擊所有代碼違規報告出現。在其他情況下(2,3)Checkstyle鏈接也沒有出現。
我現在自己也有同樣的問題。我希望有人會給出答案! – Flipbed