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 to a recent PMD version? #48

Closed
jakub-bochenski opened this issue Jul 11, 2018 · 7 comments
Closed

Upgrade to a recent PMD version? #48

jakub-bochenski opened this issue Jul 11, 2018 · 7 comments

Comments

@jakub-bochenski
Copy link

Are there any plans to provide new PMD features to Sonar?
The version shipped is over 2 years old

@raviteja50cent
Copy link

raviteja50cent commented Jul 30, 2018

Can someone help me on this,
Does sonar-pmd-plugin 2.6 have support for Java 10?

I am seeing below error on a project using Java 10.

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project clean-contacts-rest-api: java.lang.IllegalArgumentException: Unsupported Java version for PMD: 10 -> [Help 1]

@jakub-bochenski
Copy link
Author

I'm afraid forking the plugin is the only way to go :(

@raviteja50cent
Copy link

raviteja50cent commented Jul 30, 2018

Is there a way I can skip the PMD plugin during sonar analysis?

Below is the latest error that I'm seeing

`
[INFO] Java Main Files AST scan (done) | time=6382ms
30-Jul-2018 03:42:56 | [INFO] Java Test Files AST scan
30-Jul-2018 03:42:56 | [INFO] 9 source files to be analyzed
30-Jul-2018 03:42:57 | [WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
30-Jul-2018 03:42:57 | [INFO] 9/9 source files have been analyzed
30-Jul-2018 03:42:57 | [INFO] Java Test Files AST scan (done) | time=548ms
30-Jul-2018 03:42:57 | [INFO] Sensor JavaSquidSensor [java] (done) | time=7421ms
30-Jul-2018 03:42:57 | [INFO] Sensor PmdSensor [pmd]
30-Jul-2018 03:42:57 | [INFO] Execute PMD 5.4.2...
30-Jul-2018 03:42:57 | [INFO] Execute PMD 5.4.2 done: 29 ms
30-Jul-2018 03:42:57 | [INFO] ------------------------------------------------------------------------
30-Jul-2018 03:42:57 | [INFO] Reactor Summary:
30-Jul-2018 03:42:57 | [INFO]
30-Jul-2018 03:42:57 | [INFO] clean-contacts-rest-api ............................ FAILURE [ 55.239 s]
30-Jul-2018 03:42:57 | [INFO] Client : clean-contacts-rest-api ................... SKIPPED
30-Jul-2018 03:42:57 | [INFO] Svc : clean-contacts-rest-api ...................... SKIPPED
30-Jul-2018 03:42:57 | [INFO] ------------------------------------------------------------------------
30-Jul-2018 03:42:57 | [INFO] BUILD FAILURE
30-Jul-2018 03:42:57 | [INFO] ------------------------------------------------------------------------
30-Jul-2018 03:42:57 | [INFO] Total time: 57.361 s
30-Jul-2018 03:42:57 | [INFO] Finished at: 2018-07-30T10:42:57+00:00
30-Jul-2018 03:42:57 | [INFO] Final Memory: 52M/190M
30-Jul-2018 03:42:57 | [INFO] ------------------------------------------------------------------------
30-Jul-2018 03:42:57 | [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project clean-contacts-rest-api: java.lang.IllegalArgumentException: Unsupported Java version for PMD: 9 -> [Help 1]

`

@jhlee811
Copy link

jhlee811 commented Aug 3, 2018

I am also interested in this issue.
latest PMD version 6.6.0 is released on 29th July 2018.
It's quite a long gap

@ummels
Copy link

ummels commented Aug 3, 2018

Try to put the following in your pom.xml:

<build>
    <pluginManagement>
        <plugins>
            <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>6.6.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            ....

The log still says "Execute PMD 5.4.2..." but it is working with Java 8, so the used version must be higher.

@timwebster9
Copy link
Collaborator

I'm afraid forking the plugin is the only way to go :(

... and then submitting a PR :-). This is a community plugin, and while I no longer have time to maintain it I might be able to help with PRs/releases if no one else is interested. You can always get in touch with SonarSource if you want to become a collaborator as well...

@raviteja50cent
Copy link

@ummels Thanks for providing the information.

I will make changes and execute.

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

5 participants