Jenkins + Maven 㧠JavaNCSS ãã©ã°ã¤ã³ã使ã
Jenkins 㧠Java ããã¸ã§ã¯ããç¶ç¶çã¤ã³ãã°ã¬ã¼ã·ã§ã³ããéã«
è¦æ¨¡ãè¨æ¸¬ããã®ã« JavaNCSS ã便å©ã§ããã
JavaNCSS ã¨ã¯ï¼
JavaNCSS ã® NCSS 㯠Non Commenting Source Statements ã®ç¥ã§
ã½ã¼ã¹ã³ã¼ãã®è¡ã®ãã¡ã³ã¡ã³ã(ã空è¡)ã§ãªãè¡ã®ãã¨ã§ããã
JavaNCSS ã使ãã°ãå人ã®ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ã«å·¦å³ãããã«
æ¬è³ªçãªè¦æ¨¡ãè¨æ¸¬ãããã¨ãã§ããã
Jenkins + Maven ã§ä½¿ãå ´åã®åé¡ç¹
Jenkins ä¸ã§ Maven ããã¸ã§ã¯ãã§ä½¿ããã¨ããã¨åé¡ãããã
Jenkins ã®ã¸ã§ãã®è¨å®ã§
mvn package site
ã¨ãã¦ããã¬ãã¼ãã表示ãããªãã
Checkstyle ã FindBugs ã§ã¯åºãã®ã«ãJavaNCSS ã¯ãªãã表示ãããªãã
åå ã¯ãJavaNCSS ãã©ã°ã¤ã³ã site ã´ã¼ã«ã§å¼ã³åºããããã¨ãæ³å®ãã¦ããªãããã§ããã
[解決ç1] JavaNCSS ã®ã´ã¼ã«ãæ示çã«å¼ã³åºã
JavaNCSS ã®ã¬ãã¼ããçæããã´ã¼ã«ãæ示çã«å¼ã³åºãã°ããã
ä¾ãã°ã¸ã§ãã®è¨å®ã§
mvn package javancss:report
ã¨ããã°ãJavaNCSS ã®ã¬ãã¼ãã表示ãããããã«ãªãã
ãããããã®æ¹æ³ã«ã¯åé¡ããã£ã¦ä¾ãã°ã¸ã§ãã®è¨å®ã§
mvn package site javancss:report
ã®ããã« site ã´ã¼ã«ã¨åæã«å¼ã³åºãã¦ãã¾ãã¨ã
è¦æ¨¡ã2åã«éè¨ããã¦ã¬ãã¼ããçæããã¦ãã¾ãã
[解決ç2] Jenkins JavaNCSS ãã©ã°ã¤ã³ã«ããããå½ã¦ã
(追è¨) ãã®ä½æ¥ã¯ä¸è¦ã«ãªãã¾ããã詳ããã¯è¿½è¨ããåç §ãã ããã
Jenkins JavaNCSS ãã©ã°ã¤ã³ã®ã½ã¼ã¹ã¯ä»¥ä¸ã§å
¬éããã¦ãã
https://svn.jenkins-ci.org/trunk/hudson/plugins/javancss
ããã«ä»¥ä¸ã®ããããå½ã¦ãã
A patch for Jenkins JavaNCSS Plugin with "mvn site" · GitHub
Index: src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java =================================================================== --- src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java (revision 39313) +++ src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java (working copy) @@ -47,8 +47,8 @@ private static final String PLUGIN_EXECUTE_GOAL = "report"; protected boolean isExecutingMojo(MojoInfo mojo) { - return mojo.pluginName.matches(PLUGIN_GROUP_ID, PLUGIN_ARTIFACT_ID) - && PLUGIN_EXECUTE_GOAL.equals(mojo.getGoal()); + return (mojo.pluginName.matches(PLUGIN_GROUP_ID, PLUGIN_ARTIFACT_ID) + && PLUGIN_EXECUTE_GOAL.equals(mojo.getGoal())) || "site".equals(mojo.getGoal()); } protected Ghostwriter newGhostwriter(MavenProject pom, MojoInfo mojo) {
ãã£ã¦ãããã¨ã¯ site ã´ã¼ã«ãå¼ã³åºãããå ´åã«ã
JavaNCSS ã®ã¬ãã¼ããçæããããã«ãã¦ããã ãã
Jenkins ãã©ã°ã¤ã³ã®ãã«ãæ¹æ³ã¯
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial ãåèã«
settings.xml ãç½®ãã¦ã$mvn package ãå®è¡ããã
ãã«ããçµãã£ãã
Jenkins ã®ç®¡ç > ãã©ã°ã¤ã³ã®ç®¡ç > é«åº¦ãªè¨å® > ãã©ã°ã¤ã³ã®ã¢ãããã¼ã ãã
target/javancss.hpi ãã¢ãããã¼ãããJenkins ãåèµ·åããã
ã¾ã¨ã
Jenkins JavaNCSS ãã©ã°ã¤ã³ã¯ãã½ããã¦ã§ã¢ã®è¦æ¨¡ãé 調ã«å¢ãã¦ããã®ã
ç®ã§è¦ã¦ããã£ã¦æ¥½ããããã³ã¡ã³ãã®å²åãååã§ãããããããã®ã§
ããããå½ã¦ã¦ã§ãæå¹ã«ããã¹ãï¼ã¨è¨ããããããªã¹ã¹ã¡ã
2011.06.11 追è¨
@ssogabe ãããããããåãè¾¼ãã§ãã ããã¾ããã®ã§ Ver.1.1 ããã¯ãããé©ç¨ã¯ä¸è¦ã«ãªãã¾ããï¼
JavaNCSS Plugin - Jenkins - Jenkins Wiki