[] Utiliser PMD en ligne de commande : questions...

Jacques PIOTROWSKI <[email protected]> Sun, 27 Mar 2011 12:26:06 +0200
Newsgroups gmane.comp.java.netbeans.general.french
Message-ID <[email protected]>
--Apple-Mail-62-791819801
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: quoted-printable

Bonjour,

quelqu'un a-t'il d=E9j=E0 utilis=E9 PMD en ligne de commande ? Les =
plugins =20
ne marchent pas pour NetBeans 6.8 ...

J'ai essay=E9 =E7a dans le Terminal :

cd $PMD
./pmd.sh /Users/jacquespiotrowski/NetBeansProjects/<Dossier>/src/java/=20=

<Package>/<classe>.java xml basic,design > $PMD_RESULT/pmd_errors.xml

Mais le fichier pmd_erros.xml contient seulement :

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<pmd version=3D"4.2.5" timestamp=3D"2011-03-27T12:14:53.164">
</pmd>

Ca voudrait dire "sans erreurs d=E9tect=E9es par PMD ?"

Je n'arrive pas =E0 utiliser les nombreuses options...car bien entendu =20=

on peut aussi directement lancer le JAR de PMD :

Mandatory arguments:
1) A java source code filename or directory
2) A report format
3) A ruleset filename or a comma-delimited string of ruleset filenames

For example:
c:\> java -jar pmd-4.2.5.jar c:\my\source\code html unusedcode

Optional arguments that may be put before or after the mandatory =20
arguments:
-debug: prints debugging information
-targetjdk: specifies a language version to target - 1.3, 1.4, 1.5, =20
1.6 or 1.7; default is 1.5
-cpus: specifies the number of threads to create
-encoding: specifies the character set encoding of the source code =20
files PMD is reading (i.e., UTF-8)
-excludemarker: specifies the String that marks the a line which PMD =20
should ignore; default is NOPMD
-shortnames: prints shortened filenames in the report
-linkprefix: path to HTML source, for summary html renderer only
-lineprefix: custom anchor to affected line in the source file, for =20
summary html renderer only
-minimumpriority: rule priority threshold; rules with lower priority =20
than they will not be used
-nojava: do not check Java files; default to check Java files
-jsp: check JSP/JSF files; default to do not check JSP/JSF files
-reportfile: send report output to a file; default to System.out
-benchmark: output a benchmark report upon completion; default to =20
System.err
-xslt: override default xslt for 'nicehtml' output.
-auxclasspath: specifies the classpath for libraries used by the =20
source code (used by type resolution)
    (alternatively, a 'file://' URL to a text file containing path =20
elements on consecutive lines)

For example on windows:
c:\> java -jar pmd-4.2.5.jar c:\my\source\code text unusedcode,imports =20=

-targetjdk 1.5 -debug
c:\> java -jar pmd-4.2.5.jar c:\my\source\code xml basic,design -=20
encoding UTF-8
c:\> java -jar pmd-4.2.5.jar c:\my\source\code html typeresolution -=20
auxclasspath commons-collections.jar;derby.jar
c:\> java -jar pmd-4.2.5.jar c:\my\source\code html typeresolution -=20
auxclasspath file:///C:/my/classpathfile

For example on *nix:
$ java -jar pmd-4.2.5.jar /home/workspace/src/main/java/code nicehtml =20=

basic,design
$ java -jar pmd-4.2.5.jar /home/workspace/src/main/java/code nicehtml =20=

basic,design -xslt my-own.xsl
$ java -jar pmd-4.2.5.jar /home/workspace/src/main/java/code nicehtml =20=

typeresolution -auxclasspath commons-collections.jar:derby.jar


Les variables suivantes sont d=E9finies ainsi :

$PMD =3D /Applications/5-PROGRAMMATION/pmd-4.2.5/bin
$PMD_RESULT =3D /Users/jacquespiotrowski/ValiderJava/PmdErrors

Merci d'avance de votre aide.

PJ




--Apple-Mail-62-791819801
Content-Type: text/html;
	charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; =
">Bonjour,<div><br></div><div>quelqu'un a-t'il d=E9j=E0 utilis=E9 PMD en =
ligne de commande ? Les plugins ne marchent pas pour NetBeans 6.8 =
...</div><div><br></div><div>J'ai essay=E9 =E7a dans le Terminal =
:</div><div><br></div><div>cd $PMD</div><div><div>./pmd.sh =
/Users/jacquespiotrowski/NetBeansProjects/<b>&lt;Dossier&gt;</b>/src/java/=
<b>&lt;Package&gt;</b>/<b>&lt;classe&gt;</b>.java xml basic,design &gt; =
$PMD_RESULT/pmd_errors.xml</div><div><br></div><div>Mais le fichier =
pmd_erros.xml contient seulement =
:</div><div><br></div><div><div>&lt;?xml version=3D"1.0" =
encoding=3D"UTF-8"?&gt;</div><div>&lt;pmd version=3D"4.2.5" =
timestamp=3D"2011-03-27T12:14:53.164"&gt;</div><div>&lt;/pmd&gt;</div></di=
v><div><br></div><div>Ca voudrait dire "sans erreurs d=E9tect=E9es par =
PMD ?"</div><div><br></div><div>Je n'arrive pas =E0 utiliser les =
nombreuses options...car bien entendu on peut aussi directement lancer =
le JAR de PMD :</div><div><br></div><div><div>Mandatory =
arguments:</div><div>1) A java source code filename or =
directory</div><div>2) A report format&nbsp;</div><div>3) A ruleset =
filename or a comma-delimited string of ruleset =
filenames</div><div><br></div><div>For example:&nbsp;</div><div>c:\&gt; =
java -jar pmd-4.2.5.jar c:\my\source\code html =
unusedcode</div><div><br></div><div>Optional arguments that may be put =
before or after the mandatory arguments:&nbsp;</div><div>-debug: prints =
debugging information</div><div>-targetjdk: specifies a language version =
to target - 1.3, 1.4, 1.5, 1.6 or 1.7; default is 1.5</div><div>-cpus: =
specifies the number of threads to create</div><div>-encoding: specifies =
the character set encoding of the source code files PMD is reading =
(i.e., UTF-8)</div><div>-excludemarker: specifies the String that marks =
the a line which PMD should ignore; default is =
NOPMD</div><div>-shortnames: prints shortened filenames in the =
report</div><div>-linkprefix: path to HTML source, for summary html =
renderer only</div><div>-lineprefix: custom anchor to affected line in =
the source file, for summary html renderer =
only</div><div>-minimumpriority: rule priority threshold; rules with =
lower priority than they will not be used</div><div>-nojava: do not =
check Java files; default to check Java files</div><div>-jsp: check =
JSP/JSF files; default to do not check JSP/JSF =
files</div><div>-reportfile: send report output to a file; default to =
System.out</div><div>-benchmark: output a benchmark report upon =
completion; default to System.err</div><div>-xslt: override default xslt =
for 'nicehtml' output.</div><div>-auxclasspath: specifies the classpath =
for libraries used by the source code (used by type =
resolution)</div><div>&nbsp;&nbsp; (alternatively, a 'file://' URL to a =
text file containing path elements on consecutive =
lines)</div><div><br></div><div>For example on =
windows:&nbsp;</div><div>c:\&gt; java -jar pmd-4.2.5.jar =
c:\my\source\code text unusedcode,imports -targetjdk 1.5 =
-debug</div><div>c:\&gt; java -jar pmd-4.2.5.jar c:\my\source\code xml =
basic,design -encoding UTF-8</div><div>c:\&gt; java -jar pmd-4.2.5.jar =
c:\my\source\code html typeresolution -auxclasspath =
commons-collections.jar;derby.jar</div><div>c:\&gt; java -jar =
pmd-4.2.5.jar c:\my\source\code html typeresolution -auxclasspath <a =
href=3D"file:///C:/my/classpathfile">file:///C:/my/classpathfile</a></div>=
<div><br></div><div>For example on *nix:&nbsp;</div><div>$ java -jar =
pmd-4.2.5.jar /home/workspace/src/main/java/code nicehtml =
basic,design</div><div>$ java -jar pmd-4.2.5.jar =
/home/workspace/src/main/java/code nicehtml basic,design -xslt =
my-own.xsl</div><div>$ java -jar pmd-4.2.5.jar =
/home/workspace/src/main/java/code nicehtml typeresolution -auxclasspath =
commons-collections.jar:derby.jar</div></div><div><br></div><div><br></div=
><div>Les variables suivantes sont d=E9finies ainsi =
:</div><div><br></div><div>$PMD =
=3D&nbsp;/Applications/5-PROGRAMMATION/pmd-4.2.5/bin</div><div>$PMD_RESULT=
 =3D =
/Users/jacquespiotrowski/ValiderJava/PmdErrors</div><div><br></div><div>Me=
rci d'avance de votre =
aide.</div><div><br></div><div>PJ</div><div><br></div><div><br></div><br><=
/div></body></html>=

--Apple-Mail-62-791819801--