Ant/PMD のバックアップ差分(No.6)
- バックアップ一覧
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Ant/PMD へ行く。
- 1 (2012-01-25 (水) 00:21:32)
- 2 (2012-01-25 (水) 18:15:05)
- 3 (2012-07-20 (金) 12:33:24)
- 4 (2012-10-15 (月) 16:11:34)
- 5 (2013-10-30 (水) 21:46:14)
- 6 (2014-07-31 (木) 18:53:58)
- 7 (2014-08-14 (木) 16:39:21)
- 8 (2014-09-02 (火) 16:17:04)
- 9 (2014-09-26 (金) 19:13:24)
- 10 (2014-11-11 (火) 19:31:07)
- 11 (2015-08-03 (月) 15:53:51)
- 12 (2016-03-03 (木) 18:51:49)
- 13 (2016-06-16 (木) 16:41:18)
- 14 (2017-04-26 (水) 20:15:32)
- 15 (2017-04-26 (水) 21:57:44)
- 16 (2017-04-27 (木) 16:05:12)
- 17 (2017-05-12 (金) 16:06:53)
- 18 (2017-05-12 (金) 18:42:14)
- 19 (2017-06-02 (金) 14:08:56)
- 20 (2017-10-09 (月) 15:56:30)
- 21 (2017-10-31 (火) 19:45:54)
- 22 (2017-11-01 (水) 17:16:30)
- 23 (2017-11-28 (火) 14:04:25)
- 24 (2017-11-28 (火) 20:23:27)
- 25 (2017-12-19 (火) 16:17:22)
- 26 (2017-12-19 (火) 18:07:30)
- 27 (2018-02-26 (月) 18:33:04)
- 28 (2018-06-28 (木) 17:53:00)
- 29 (2018-07-01 (日) 00:39:54)
- 30 (2018-07-04 (水) 20:12:03)
- 31 (2018-07-31 (火) 14:30:43)
- 32 (2018-09-19 (水) 10:20:47)
- 33 (2018-10-30 (火) 16:46:43)
- 34 (2019-05-22 (水) 19:35:38)
- 35 (2019-08-30 (金) 15:42:28)
- 追加された行はこの色です。
- 削除された行はこの色です。
TITLE:AntでPMDを実行する #navi(../) *AntでPMDを実行する [#le25bc07] #adsense2 >編集者:[[Terai Atsuhiro>aterai]]~ 作成日:2012-01-24~ 更新日:&lastmod; #contents(none) **概要 [#s4081d7a] AntからPMDを実行します。 `Ant`から`PMD`を実行します。 **サンプルターゲット [#h0deaf72] #code{{ <target name="pmd"> <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" /> <mkdir dir="${build.reports}" /> <pmd rulesetfiles="java-basic,java-imports,java-strings" encoding="${compile.encoding}"> <classpath refid="project.class.path" /> <formatter type="xml" toFile="${build.reports}/pmd.xml" /> <formatter type="text" toConsole="true" /> <fileset dir="${src.dir}"> <include name="**/*.java" /> </fileset> </pmd> </target> }} **解説 [#i9aab092] +[http://pmd.sourceforge.net/ PMD]からダウンロードしたpmd-bin-4.3.zipのlib以下にあるpmd-4.3.jarなどのjarファイルを%ANT_HOME%\lib にコピー + ant pmd で、pmd.xml を生成し、jenkinsのPMDプラグインなどで読み込む + [http://pmd.sourceforge.net/ PMD]からダウンロードした`pmd-bin-x.x.zip`の`lib`以下にある`pmd-x.x.jar`などの`jar`ファイルを`%ANT_HOME%\lib`にコピー + `ant pmd`で、`pmd.xml`を生成し、`jenkins`の`PMD`プラグインなどで読み込む *** toFile or toConsole [#w61eb2ba] FindBugsのように、xmlファイルとコンソールの両方に結果を表示したい場合が多いのですが、 `FindBugs`のように、`xml`ファイルとコンソールの両方に結果を表示したい場合が多いのですが、 ant -v pmd では、情報が多すぎるので formatter 要素の toConsole 属性を使用します。 - [http://pmd.sourceforge.net/snapshot/ant-task.html PMD - Ant Task] にあるように、<formatter type="html" toFile="pmd_report.html" toConsole="true"/> や、<formatter type="xml" toFile="${build.reports}/pmd.xml" toConsole="true" /> と toFile と toConsole を指定しても、ファイルにのみ結果が書き出されて、コンソールには何も出力されない - <formatter type="text" toConsole="true" /> と、toFile 属性なしでtoConsole="true"とする必要がある? -- <formatter type="text" toConsole="false" /> は、「toFile or toConsole needs to be specified in Formatter」となって、BUILD FAILED - ファイルとコンソールの両方に出力する場合は、formatterを複数指定しなくてはならない? では、情報が多すぎるので`formatter`要素の`toConsole`属性を使用します。 - [http://pmd.sourceforge.net/snapshot/ant-task.html PMD - Ant Task] にあるように、`<formatter type="html" toFile="pmd_report.html" toConsole="true"/>`や、`<formatter type="xml" toFile="${build.reports}/pmd.xml" toConsole="true" />`と`toFile`と`toConsole`を指定しても、ファイルにのみ結果が書き出されて、コンソールには何も出力されない - `<formatter type="text" toConsole="true" />`と、`toFile`属性なしで`toConsole="true"`とする必要がある? -- `<formatter type="text" toConsole="false" />`は、`toFile or toConsole needs to be specified in Formatter`となって、`BUILD FAILED` - ファイルとコンソールの両方に出力する場合は、`formatter`を複数指定しなくてはならない? *** PMD 5.0.0 [#wf0618ac] - RuleSet short names now require a language prefix, 'basic' is now 'java-basic', and 'rulesets/basic.xml' is now 'rulesets/java/basic.xml' -- 上記のサンプルで、rulesetfiles属性のbasicなどを、 java-basicに変更 - Removed -targetjdk use -version {name} {version} instead -- 上記のサンプルから、targetjdk="${compile.source}"を削除 - `RuleSet short names now require a language prefix, 'basic' is now 'java-basic', and 'rulesets/basic.xml' is now 'rulesets/java/basic.xml'` -- 上記のサンプルで、`rulesetfiles`属性の`basic`などを、`java-basic`に変更 - `Removed -targetjdk use -version {name} {version} instead` -- 上記のサンプルから、`targetjdk="${compile.source}"`を削除 **参考リンク [#c56145b8] - [http://pmd.sourceforge.net/ PMD] - [http://d.hatena.ne.jp/guess880/20121014/1350200644 PMD5.0.0のルールを和訳しながら読む - 1 - Design Ruleset - 開発メモ] **コメント [#sc369256] #comment