This task requires Metamata Development environment 2.0/Webgain Quality Analyzer 2.0. An evaluation version is available at Webgain. , Jakarta Oro and a XML parser (via JAXP).
Invokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files.
maudit performs static analysis of the Java source code and byte code files to find and report errors of style and potential problems related to performance, maintenance and robustness. . As a convenience, a stylesheet is given in etc directory, so that an HTML report can be generated from the XML file.
Attribute | Description | Required |
tofile | The XML file to which the Audit result should be written to. | Yes |
metamatahome | The home directory containing the Metamata distribution. | Yes |
fix | Automatically fix certain errors (those marked as fixable in the manual). | No.Default to false. |
list | Creates listing file for each audited file. A .maudit file will be generated in the same location as the source file. | No. Default to false. |
unused | Finds declarations unused in search paths. It will look for unused global declarations in the source code within a use domain specified by the searchpath element. | No. Default to false. |
maxmemory | Set the maximum memory for the JVM. this is a convenient way to set the -mx or -Xmx argument. | No |
Additional parameters may be passed to the VM via nested <jvmarg>
attributes. <jvmarg>
allows all attributes described in
Command line arguments.
You can avoid using the <jvmarg>
by adding these empty
entries to metamata.properties
located at ${metamata.home}/bin
metamata.classpath= metamata.sourcepath= metamata.baseclasspath=
Sets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables. The classpath element represents a PATH like structure.
Sets source path. Overrides the SOURCEPATH environment variable. The sourcepath element represents a PATH like structure.
Sets the search path to use as the use domain when looking for unused global declarations. The searchpath element represents a PATH like structure.
Sets the Java files to audit via a FILESET structure. Whatever the filter is, only the files that ends with .java will be included for processing. Note that the base directory used for the fileset MUST be the root of the source files otherwise package names deduced from the file path will be incorrect.
<maudit tofile="c:/metamata/examples/auditexamples/audit.xml" metamatahome="c:/metamata" fix="yes"> <classpath> <pathelement location="c:/metamata/examples/auditexamples"/> </classpath> <sourcepath> <pathelement location="c:/metamata/examples/auditexamples"/> </sourcepath> <fileset dir="c:/metamata/examples/auditexamples"> <include name="*.java"/> </fileset> </maudit>
This invokes Metamata Audit installed in c:/metamata on the audit examples and fix automatically the fixable errors.
<style in=java "${audit.xml}" style="maudit-frames.xsl" out="null.tmp"> <param name="output.dir" expression="${report.dir}"/> </style>
Copyright © 2001-2002,2004 The Apache Software Foundation. All rights Reserved.