Skip to main content
Dec 13, 2009 10:12 PM UTC
Answered

i feel stupid :)

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(ResourceLoader.java:28)

  [flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleSetReferenceNode(RuleSetFactory.java:284)

  [flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java:251)

  [flexPmd] at net.sourceforge.pmd.RuleSetFactory.parseRuleSetNode(RuleSetFactory.java: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(AbstractFlexPmdEngine.java:184)

  [flexPmd] at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.<init>(AbstractFlexPmdEngine.java:100)

I set it up like on the doc page and if i echo the task with filled in paths i get the right ones:
Buildfile: build.xml
     [echo]
     [echo]
     [echo] <taskdef name="flexPmd"
     [echo] classname="com.adobe.ac.pmd.ant.FlexPmdAntTask"
     [echo] classpath="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-ant-task-1.0.jar">
     [echo] <classpath>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-parser-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-parser-api-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-plugin-utils-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/commons-lang-2.4.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-core-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-files-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-ruleset-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-ruleset-api-1.0.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/plexus-utils-1.0.2.jar"/>
     [echo] <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/pmd-4.2.5.jar"/>
     [echo] </classpath>
     [echo] </taskdef>
     [echo]
     [echo]
i call the task without a ruleset so it should use the default one, right?

<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

This topic is closed to new replies. Start a new post to keep the conversation going.
clottonCorrect answer
Inspiring
Oct 19, 2010 3:51 PM UTC

We resolved the issue.

It seems the Ant 1.7 supplied to us contained an old pmd-4.1.jar in the lib directory.   Removing that jar solves the problem.  This jar wasn't present in the supplied Ant 1.8, which is why that version worked.

18 replies

clottonCorrect answer
Inspiring
Oct 19, 2010 3:51 PM UTC

We resolved the issue.

It seems the Ant 1.7 supplied to us contained an old pmd-4.1.jar in the lib directory.   Removing that jar solves the problem.  This jar wasn't present in the supplied Ant 1.8, which is why that version worked.

Translate
Nov 25, 2010 1:31 PM UTC

I can confirm this. Problem is gone in a clean ant 1.8.1 installation

cheers,

Arnoud

Translate
Inspiring
Oct 6, 2010 6:22 PM UTC

I just got it to work by switching to Ant 1.8.

Translate
Inspiring
Dec 14, 2009 6:41 AM UTC

Ok. Your error means that your flex-pmd-ruleset-1.0-jar is not foud.

You need to make sure that this file is in the class-path.

Xavier

Translate
Dec 14, 2009 9:06 AM UTC

Hi thanx for the fast reply.

Does that mean that including the jars in the taskdef of flexPmdAntTask is not sufficient? Now i have:

<taskdef name="flexPmd"
    classname="com.adobe.ac.pmd.ant.FlexPmdAntTask"
    classpath="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-ant-task-1.0.jar">
    <classpath>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-parser-1.0.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-parser-api-1.0.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/as3-plugin-utils-1.0.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/commons-lang-2.4.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-core-1.0.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-files-1.0.jar"/>
         <pathelement location="/Users/arnoudbos/Desktop/AgileFlex2/_build/taskdef-lib/flexpmd/1.0/flex-pmd-ruleset-1.0.jar"/>
etc...
i verified the paths, if i have to include the .jars in the classpath in another way i wonder why they should be included like above?
any further insights?
Thanx
Arnoud

Translate
Inspiring
Oct 6, 2010 2:28 PM UTC

Did you ever get this to work?

I'm having the EXACT same problem, and I've verified that my paths are correct, file names are correct, etc.  I just can't figure out why it's not picking up the ruleset jar, when it's clearly there.

Any ideas?

Translate