Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pmd version to the latest one for parsing Java 8 code successfully #34

Closed
MiErnst opened this issue Feb 23, 2017 · 0 comments
Closed

Comments

@MiErnst
Copy link

MiErnst commented Feb 23, 2017

Processing our source results in PMDExceptions and the file will be ignored and an ERROR will be logged by the sonar-maven-plugin.
Example code which fails:
Collections::<String> emptyList

net.sourceforge.pmd.PMDException: Error while parsing ...
Caused by: net.sourceforge.pmd.lang.java.ast.ParseException: Encountered " "::" ":: "" at line 68, column 59.
Was expecting one of:
    ")" ...
    "," ...
    "++" ...
    "--" ...

By upgrading the plugin dependency the problem is solved:

<plugin>
   <groupId>org.sonarsource.scanner.maven</groupId>
   <artifactId>sonar-maven-plugin</artifactId>
   <version>3.2</version>
   <dependencies>
      <dependency>
         <groupId>net.sourceforge.pmd</groupId>
         <artifactId>pmd-java</artifactId>
         <version>5.5.3</version>
      </dependency>
   </dependencies>
</plugin>

The sonar-maven-plugin still logs :

[INFO] Sensor PmdSensor
[INFO] Execute PMD 5.4.2...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant