You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by javed mandary <ja...@gmail.com> on 2006/02/09 15:13:00 UTC

M2.0.2 PMD , enum and JDK 1.5

Hi all,
         am currently having a problem when running site with m2.0.2  , I
have configured PMD in reporting tag:

------------- POM extract------------------
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <rulesets>
                        <ruleset>/rulesets/basic.xml</ruleset>
                        <ruleset>/rulesets/controversial.xml</ruleset>
                    </rulesets>
                    <format>xml</format>
                    <linkXref>true</linkXref>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                </configuration>
            </plugin>
----------------------------------------------------

Am using JDK 1.5 however but in a certain class I have used "enum" and PMD
is not very happy about that and throws an exception:


-----------------Extract console -----------------------------------------
[INFO] Error during report generation

Embedded error: Failure executing PMD for: C:\devtools\mvnwork\FILES\9feb\c
ore\presentation\reffapp-web-core-presentation-web\src\main\java\com\Answer.java
ERROR: Can't use enum as a keyword in pre-JDK 1.5 target
----------------------------------------------------------------------------------------------------------------

Is there any workaround such as my site generation continues , with PMD just
ignoring  "enum" ?

kind regards,
         Javed

Re: M2.0.2 PMD , enum and JDK 1.5

Posted by Wim Deblauwe <wi...@gmail.com>.
The jdk setting is independent for each plugin, so you have to tell the PMD
plugin that you are using JDK 1.5 in your code.

regards,

Wim

2006/2/9, javed mandary <ja...@gmail.com>:
>
> Hi all,
>          am currently having a problem when running site with m2.0.2  , I
> have configured PMD in reporting tag:
>
> ------------- POM extract------------------
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-pmd-plugin</artifactId>
>                 <configuration>
>                     <rulesets>
>                         <ruleset>/rulesets/basic.xml</ruleset>
>                         <ruleset>/rulesets/controversial.xml</ruleset>
>                     </rulesets>
>                     <format>xml</format>
>                     <linkXref>true</linkXref>
>                     <sourceEncoding>utf-8</sourceEncoding>
>                     <minimumTokens>100</minimumTokens>
>                 </configuration>
>             </plugin>
> ----------------------------------------------------
>
> Am using JDK 1.5 however but in a certain class I have used "enum" and PMD
> is not very happy about that and throws an exception:
>
>
> -----------------Extract console -----------------------------------------
> [INFO] Error during report generation
>
> Embedded error: Failure executing PMD for:
> C:\devtools\mvnwork\FILES\9feb\c
>
> ore\presentation\reffapp-web-core-presentation-web\src\main\java\com\Answer.java
> ERROR: Can't use enum as a keyword in pre-JDK 1.5 target
>
> ----------------------------------------------------------------------------------------------------------------
>
> Is there any workaround such as my site generation continues , with PMD
> just
> ignoring  "enum" ?
>
> kind regards,
>          Javed
>
>