• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

i feel stupid :)

Guest
Dec 13, 2009 Dec 13, 2009

Copy link to clipboard

Copied

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

TOPICS
FlexPMD

Views

3.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Oct 19, 2010 Oct 19, 2010

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.

Votes

Translate

Translate
Adobe Employee ,
Dec 13, 2009 Dec 13, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 14, 2009 Dec 14, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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    

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

Thank you for the link, but I'm afraid it doesn't contain a build. Only a jar with one xml file in it.

Do older versions of flex pmd work?

Thanks

Chris

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

Hi,

it's not a build, it's an update site for the eclipse plugin. I think I've missed read your thread though thinking you had a problem with the eclipse plugin and the project paths

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

No, the issue is with the ant task, not the eclipse plugin.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

Did you add the ruleset jar to the ant task classpath?

That's all you should need to do.

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

Yes, and confirmed its path and spelling is valid. Like Arnoud, I've used the example ant task provided.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

Just to confirm,

for me it was the ant task too that didn't work.

Arnoud

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

FYI, I've tried version 1.2, 1.1, and 1.0 with the same result:

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

at net.sourceforge.pmd.util.ResourceLoader.loadResourceAsStream(ResourceLoader.java:28)

at net.sourceforge.pmd.RuleSetFactory.parseRuleNodeWithExclude(RuleSetFactory.java:385)

at net.sourceforge.pmd.RuleSetFactory.parseExternallyDefinedRuleNode(RuleSetFactory.java:331)

at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java:263)

at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:199)

at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:172)

at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.loadRuleset(AbstractFlexPmdEngine.java:181)

at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.(AbstractFlexPmdEngine.java:100)

at com.adobe.ac.pmd.engines.FlexPmdXmlEngine.(FlexPmdXmlEngine.java:58)

at com.adobe.ac.pmd.ant.FlexPmdAntTask.execute(FlexPmdAntTask.java:58)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)

at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)

at org.eclipse.ant.internal.launching.remote.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)

at org.apache.tools.ant.Project.executeTargets(Project.java:1181)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)

at org.apache.tools.ant.Project.executeTarget(Project.java:1298)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

at org.apache.tools.ant.Project.executeTargets(Project.java:1181)

at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)

at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2010 Oct 19, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 25, 2010 Nov 25, 2010

Copy link to clipboard

Copied

LATEST

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

cheers,

Arnoud

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines