The compiler plugin parameter for JDK 1.5 is used for compiling sources.

if you want PMD to know that it should 1.5, you should also tell it via a configuration using targetJDK


Geoffrey wrote:

I have a project with 1.5 java code. It has the following compile/reports configuration in the pom.xml:

    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
...
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
            </plugin>
...
        </plugins>
    </reporting>


When I run "mvn site" I get:


[ERROR] VM #displayTree: error : too few arguments to macro. Wanted 2 got 0
[ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1 got 0
[INFO] Generate "PMD Report" report.
[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] Error during report generation

Embedded error: Failure executing PMD for: d:\projects\x1\x2\src\com\x3\x4\Hibernate\TestHiberna
te.java
Can't use JDK 1.5 for loop syntax when running in JDK 1.4 mode!


Apperently pmd doesn't check the compiler's source config.
I am probably using the follow version: ~\.m2\repository\org\apache\maven\plugins\maven-pmd-plugin\2.0-alpha-2


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to