Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Static Analysis - ECJ

I am attempting to run ammended versions of the various build.xml files to run static analysis on a simple web app. I am encountering a problem with the ECJ task and it appears to stem from the fact that only the jar files located within the WEB-INF\lib folder of my app are included in the ECJ task classpath. The web app has dependencies on J2EE.jar, etc. As a result I am getting lots of "HttpServletResponse cannot be resolved to a type" errors.
Can anyone tell me how to include external jars in the ECJ task classpath?
The ant xml (ecj.xml) file being used to run the analysis taks is that which is distributed with the static-analysis package includes the lines

<target name="invokeEcj">
<delete file="${resultFile}" />

<echo message="Running static analysis (ECJ) on ${analysis.sources.dirs}" />
<echo message="with ECJ installed at ${ecjJar}" />

<java resultproperty="ecjReturnCode"
fork="true"
classpath="${ecjJar}"
classname="org.eclipse.jdt.internal.compiler.batch.Main">
<jvmarg value="-Xmx256M" />
<arg value="-1.5" />
<arg value="-cp" />
<arg value="${analysis.classpath}" />
<arg value="-d" />
<arg value="none" />
<arg value="-time"/>
<arg value="-proceedOnError"/>
<arg value="-log" />
<arg value="${resultFile}" />
<arg value="-warn:+javadoc,null,unused,uselessTypeCheck,paramAssign,emptyBlock,nls" />
<arg line="${analysis.sources.dirs}" />
</java>

<echo message="ECJ returned code ${ecjReturnCode}" />
<echo message="ECJ result file at: ${resultFile}" />

</target>

Which is called by analysis.xml


target name="analysis" >
<fileset dir="${analysisLibraryRoot}" id="analysis.all.jars" >
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep="${path.separator}" property="analysis.classpath" refid="analysis.all.jars" setonempty="false" />
<!-- set classpath to default value if it was not set just above -->
<property name="analysis.classpath" value="." />

<!-- Invoke all staticAnalysis.xml files in the workspace's projects. -->
<subant failonerror="true" inheritall="true">
<fileset dir="${analysisRoot}"
includes="*/staticAnalysis.xml" />
</subant>
</target>

Thanks in advance,
Nick

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Feb 26 '08, 12:14 p.m.

Question was seen: 5,618 times

Last updated: Feb 26 '08, 12:14 p.m.

Confirmation Cancel Confirm