'pmd'에 해당하는 글 1건



HUDSON에서 PMD를 실행하는 ANT 설정 샘플입니다. (WITH 전자정부 표준프레임워크 PMD 룰셋 파일첨부)


EgovInspectionRules_eng.xml


EgovInspectionRules_kor.xml


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="UTF-8"?>
<project name="PMD_TEST" default="pmd_run" basedir=".">
 
    <!-- User modify Configure -->
    <property name="hudson.home"        value="?"                                       />
    <property name="pmd.home"           value="C:\tools/pmd-src-5.0.1"                  />
    <property name="pmd.report"         value="${basedir}/workspace/PMD"                />
    <property name="project.dir"        value="${hudson.home}/jobs/PMD_TEST/workspace"  />
    <property name="project.dir.src"    value="${project.dir}/src"                      />
     
    <!-- set pmd lib path -->
    <path id="pmd.classpath">
        <pathelement location="${pmd.home}" />
        <fileset dir="${pmd.home}/lib" includes="*.jar" />
    </path>
 
    <!-- set pmd plugin -->
    <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath" />
     
    <!-- define pmd Ant Target -->
    <target name="pmd_run">
        <mkdir dir="${pmd.home}/report/pmd" />
        <!-- define location for saving result files -->
        <pmd rulesetfiles="${pmd.home}/src/main/resources/rulesets/internal/rules.xml">
            <formatter type="xml" toFile="${pmd.report}/pmd_report_iCAS.xml" />
            <fileset dir="${project.dir.src}">
                <include name="**/*.java" />
            </fileset>
        </pmd>
    </target>
     
</project>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="UTF-8"?>
<project name="PMD_TEST" basedir=".">
<property name="pmd.home" value="${ant.home}/pmd-src-4.3" />
<path id="pmd.classpath">
       <pathelement location="${pmd.home}" />
       <fileset dir="${pmd.home}/lib" includes="*.jar" />
</path>
<!-- pmd Ant 실행 파일 설정 -->
 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
<!-- pmd Ant Target 설정 Target 명=pmd로 설정. -->
 <target name="pmd">
  <mkdir dir="./report/pmd"/>
   <!-- 소스코드를 검사할 PMD 규칙이 설정된 파일 지정 -->
  <pmd rulesetfiles="${pmd.home}/rulesets/favorites.xml">
   <!--  분석결과 파일 저장 위치 지정 -->
  <formatter type="xml" toFile="report/pmd/pmd_report.xml" linkPrefix="http://pmd.sourceforge.net/xref"/>
  <fileset dir="src">
  <include name="**/*.java"/>
  </fileset>
  </pmd>
 </target>
</project>





'IT > ETC' 카테고리의 다른 글

구글의 좋은 관리자의 8가지 덕목  (0) 2017.03.01
ETC - FTP의 Active Mode 와 Passive Mode  (0) 2015.12.14
Specifying playback range  (0) 2015.11.05
video html5 test  (0) 2015.11.05
test  (0) 2015.10.12

WRITTEN BY
Dukejin
If you don't walk today, you will have to run tomorrow. Try hard, Try hard!

,