Hi all,
i'm trying to integrate pmd in our build with ant but get the following rror:
[flexPmd] net.sourceforge.pmd.RuleSetNotFoundException: Can't find resource com/adobe/ac/pmd/rulesets/architecture.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH
[flexPmd] at net.sourceforge.pmd.util.ResourceLoader.loadResourceAsStream(Resource Loader.java:28)
[flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleSetReferenceNode(RuleSetF actory.java:284)
[flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java: 251)
[flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleSetNode(RuleSetFactory.ja va:209)
[flexPmd] at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java: 157)
[flexPmd] at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java: 146)
[flexPmd] at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.loadRuleset(AbstractFl exPmdEngine.java:184)
[flexPmd] at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.<init>(AbstractFlexPmd Engine.java:100)
<flexPmd sourceDirectory="${src.flex.dir}" outputDirectory="${build.pmd.dir}" />
any thoughts? No one but me seems to have trouble to get the thing to work ....
i use the latest version 1.0 from the adobe opensource site
any help would be highly appreciated!
Arnoud
Hi thanx for the fast reply.
Does that mean that including the jars in the taskdef of flexPmdAntTask is not sufficient? Now i have:
Hi,
could you try using this newer build http://www.rialvalue.com/flexPmd/updateSite/
We´ll release this version early next week. this problems should be fixed there
Xavi
No, i'm afraid i couldn't get it working.
But glad to hear it's fixed in the next release. It was driving me mad for a whle :-)
we switched to maven and that's working well.
Anyway great to hear a new version is coming up.
FlexPMD is great! Also sonar flex (build on top of flex pmd) looks really promising!
Arnoud
I think it would greatly help to state if the taskdef in the post http://forums.adobe.com/message/2458304#2458304
is correct.
See the last pathelement, that should suffice, right?
do you need to do more?
maybe it's fixed in subsequent releases which i didn't try with ant
Arnoud
FYI, I've tried version 1.2, 1.1, and 1.0 with the same result:
Re: i feel stupid :) net.sourceforge.pmd.RuleSetNotFoundException: Can't find resource com/adobe/ac/pmd/rulesets/architecture.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH
Re: i feel stupid :) at net.sourceforge.pmd.util.ResourceLoader.loadResourceAsStream(Resource Loader.java:28)
Re: i feel stupid :) at net.sourceforge.pmd.RuleSetFactory.parseRuleNodeWithExclude(RuleSetFa ctory.java:385)
Re: i feel stupid :) at net.sourceforge.pmd.RuleSetFactory.parseExternallyDefinedRuleNode(Rul eSetFactory.java:331)
Re: i feel stupid :) at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java: 263)
Re: i feel stupid :) at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java: 199)
Re: i feel stupid :) at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java: 172)
Re: i feel stupid :) at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.loadRuleset(AbstractFl exPmdEngine.java:181)
Re: i feel stupid :) at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.(AbstractFlexPmdEngine .java:100)
Re: i feel stupid :) at com.adobe.ac.pmd.engines.FlexPmdXmlEngine.(FlexPmdXmlEngine.java:58)
Re: i feel stupid :) at com.adobe.ac.pmd.ant.FlexPmdAntTask.execute(FlexPmdAntTask.java:58)
Re: i feel stupid :) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
Re: i feel stupid :) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
Re: i feel stupid :) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)
Re: i feel stupid :) at java.lang.reflect.Method.invoke(Method.java:585)
Re: i feel stupid :) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:105)
Re: i feel stupid :) at org.apache.tools.ant.Task.perform(Task.java:348)
Re: i feel stupid :) at org.apache.tools.ant.Target.execute(Target.java:357)
Re: i feel stupid :) at org.apache.tools.ant.Target.performTasks(Target.java:385)
Re: i feel stupid :) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
Re: i feel stupid :) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38)
Re: i feel stupid :) at org.eclipse.ant.internal.launching.remote.EclipseSingleCheckExecutor. executeTargets(EclipseSingleCheckExecutor.java:30)
Re: i feel stupid :) at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
Re: i feel stupid :) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
Re: i feel stupid :) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
Re: i feel stupid :) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
Re: i feel stupid :) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)
Re: i feel stupid :) at java.lang.reflect.Method.invoke(Method.java:585)
Re: i feel stupid :) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:105)
Re: i feel stupid :) at org.apache.tools.ant.Task.perform(Task.java:348)
Re: i feel stupid :) at org.apache.tools.ant.Target.execute(Target.java:357)
Re: i feel stupid :) at org.apache.tools.ant.Target.performTasks(Target.java:385)
Re: i feel stupid :) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
Re: i feel stupid :) at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
Re: i feel stupid :) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41)
Re: i feel stupid :) at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.exec uteTargets(EclipseDefaultExecutor.java:32)
Re: i feel stupid :) at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
Re: i feel stupid :) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(Inter nalAntRunner.java:423)
Re: i feel stupid :) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(Inte rnalAntRunner.java:137)
Just curious if anybody has actually used the example ant task/target successfully? I've seen plenty of blogs and tutorials online, but they all seem to just copy/paste the example ant target provided by Adobe, which leads me to believe they probably haven't used the target. If you have a successfully running flex pmd ant target, could you post it?
Thanks
Doesn't answer your question but I actually just run the jar file from a macrodef...
<java jar="${flexpmd.dir}/flex-pmd-command-line-${flexpmd.version}.jar"
fork="true" failonerror="true" outputproperty="@">
<arg value="-s@"/>
<arg value="-o@"/>
<arg value="-r@"/>
<mkdir dir="$/reports/flexpmd" /> <flexPmd sourceDirectory="$/src"
outputDirectory="$/reports/flexpmd"
ruleSet="${flexpmd.dir}/rulesets/pmd.xml"
outputProperty="flexpmd.out"/>
</target
North America
Europe, Middle East and Africa
Asia Pacific