Optional tasks don't work with IDEA 4.0


I have upgraded from 3.0.5 to 4.0 and none of the optional tasks in our build.xml file work. I get the exception:

taskdef
C:\java\projects\csp\commsales\build.xml:101: taskdef class net.sourceforge.pmd.ant.PMDTask cannot be found

Here is how we defined the pmd target:

]]>
<pmd rulesetfiles="$/conf/pmd-rulesets.xml" printtoconsole="true"
failOnRuleViolation="true" failonerror="true">
]]>
<include name="*/.java"/>
</fileset>
</pmd>
</target>

and the pmd task related jar file is there in the compile.classpathref.

I tried changing ant versions, but it does not seem to matter to IDEA 4.0. Everything works well with 3.0.5 though.

Any suggestions?

8 comments

Shireesh Thanneru <no_mail@jetbrains.com> wrote:

and the pmd task related jar file is there in the compile.classpathref.

I tried changing ant versions, but it does not seem to matter to IDEA 4.0.
Everything works well with 3.0.5 though.


Did you put the jars into the lib folder in IDEA installation folder?
The ftp task works for me if I put the Netcomponents.jar into that
folder. You have to restart IDEA for these changes to take effect. It
should be the same with your tasks.

What is compile.classpathref?

Dirk Dittert

0

I have the

in the IDEA's

folder. I did restart IDEA and it didn't work...same exception that it can't find the class.

Here is my

    
        
    
    
        
    
    
]]>


And, I am passing this

to the pmd task by using the

    
    
        
        
            
        

]]>

0

Shireesh Thanneru wrote:

>I have the

in the IDEA's

folder. I did restart IDEA and it didn't work...same exception that it can't find the class.
>
>Here is my

>
>

>    
>        
>    
>    
>        
>    
>    
>]]>

>
>And, I am passing this

to the pmd task by using the

>

>    classpathref="compile.classpath"/>
>    failOnRuleViolation="true" failonerror="true">
>        
>        
>            
>        
>
>]]>

>
You have to put your jar in the ant classpath in the Ant Properties the
same way as for junit.

Jacques

0

I have also tried putting the pmd jar in Ant's classpath just like the junit jar in the Ant Properties. I still get the same exception:


And this happens for any optional/custom task.

0

try running the ant script from console - see if it works.
look at the verbose output if ant says "dropping xy from classpath".

Remove the "additonal ant classpath" entries!
There are some issues with ant and classloading from IDEA...
I think generally using IDEA's additional ant classpath is a bad idea, because it causes ant scripts not to run from console...

I had a similar problem, but cannot describe it in full detail now from memory.
But it is worth a try: maybe it works when you put your taskef jar in the ant lib dir, and also add to classpath "ant/lib/your.jar"

0

I have tried running ant on the command line, and surprisingly I got the same exception. When I tried it with the verbose option, the real exception was clear...Ant is not able to open any of the jar files and is getting a ZipException. So, I removed the whole CVS module and checked it out again (this time, I checked out the module from the command line, instead of from IDEA). Now, Ant works both on the commandline and inside IDEA. But, when I do any CVS updates from IDEA, it again corrupts the jar files and I get the same ZipException. It definitely looks like there is something wrong in the way IDEA is checking out and updating modules (especially the binary files).

Any suggestions on how to fix this issue?

0

Did you specify "-kb" when you checked in the jar-files for the first time?

/Anders

Shireesh Thanneru wrote:

I have tried running ant on the command line, and surprisingly I got the same exception. When I tried it with the verbose option, the real exception was clear...Ant is not able to open any of the jar files and is getting a ZipException. So, I removed the whole CVS module and checked it out again (this time, I checked out the module from the command line, instead of from IDEA). Now, Ant works both on the commandline and inside IDEA. But, when I do any CVS updates from IDEA, it again corrupts the jar files and I get the same ZipException. It definitely looks like there is something wrong in the way IDEA is checking out and updating modules (especially the binary files).

Any suggestions on how to fix this issue?

0

I am able to execute ant pmd command through command prompt without any exception, but when i am using eclipse ide its not working and showing me taskdef class net.sourceforge.pmd.ant.PMDTask cannot be found.

Is there any solution for this problem am i missing any classpath setting. Please help

Thanks in advance for the help

0

Please sign in to leave a comment.