eclipse
. Youâll be asked for a workspace. Itâs recommended to use an extra, separate new workspace for PMD, because youâll import many projects. Otherwise you might clutter your existing workspace with PMD projects.File
, Import...
. In the dialog, select Maven / Existing Maven Projects
and click Next
.Root Directory
select the directory, into which PMDâs repository has been cloned.Select All
and then Finish
.Now all PMD projects are imported. This might take a while. All the projects will appear on the left inside the Project Explorer
.
While PMD still runs with Java 8, we need at least Java 11 for building and running unit tests. To make sure, Eclipse uses Java 11 instead of Java 8, go to Window > Preferences and select Java > Installed JREs. Make sure, you have a Java 11 or newer available. Then go to âExecution Environmentsâ, choose âJavaSE-1.8â and check your Java 11 installation on the right.
Running unit testsTo verify, that the basics work, right-click on the pmd-core
project and select Run As -> JUnit Test
. If everything is well, the project will be built and the unit tests are executed.
If you do this for other projects, you might get some build errors. Try to ignore them for now - at least some unit test should be executed. See also âKnown Issuesâ below.
Running / Debugging PMDPmdCli
check --help
as program argumentsWindow
-> Preferences
Java / Code Style / Code Templates
: Click Import...
and choose the file eclipse/pmd-eclipse-codetemplates.xml
from the âbuild-toolsâ repository.Java / Code Style / Formatter
: Click Import...
and choose the file eclipse/pmd-eclipse-code-formatter.xml
from the âbuild-toolsâ repository.Java / Code Style / Clean Up
: Click Import...
and choose the file eclipse/pmd-eclipse-code-cleanup.xml
from the âbuild-toolsâ repository.Java / Code Style / Organize Imports
: Click Import...
and choose the file eclipse/pmd-eclipse-imports.importorder
from the build-toolsâ repository.Apply and Close
We are going to install two plugins: The checkstyle plugin itself and the m2e-code-quality plugin, which seamlessly activates and configures checkstyle in eclipse according to the maven configuration of PMD.
Help
, Install New Software...
https://checkstyle.org/eclipse-cs-update-site
into the text field and press enter.Next
https://m2e-code-quality.github.io/m2e-code-quality-p2-site/
Next
Maven / Update project...
in the context menu. In the dialog, select all projects, unselect the option âClean projectsâ and click OK
.The designer lives in a separate repository, that youâll need to fork and clone first: Designer repository
git clone git@github.com:your_user_name/pmd-designer.git
See Contributing Guide of the Designer for details.
File
, Import...
. In the dialog, select Maven / Existing Maven Projects
and click Next
.net.sourceforge.pmd.util.fxdesigner.DesignerStarter
via menu âNavigate / Open Typeâ¦â.eclipse.ini
and replace -Xmx2048m
with -Xmx4096m
. Restart eclipse../mvnw compile
and after that select the top level project in Project Explorer (âpmdâ) and use âFile > Refreshâ. Then enable âBuild Automaticallyâ again.There is no good Kotlin support for Eclipse. Many tests depend on Kotlin and at least pmd-apex uses Kotlin for the main sources. This means, you need to compile the project with Maven without Eclipse.
As long as you donât need to change the Kotlin code, you can ignore this for now. In order to be able to execute the tests, there is a workaround:
$ ./mvnw clean install -f pmd-lang-test/pom.xml
This installs this module in your local maven repository.pmd-scala project has no source code / tests: If you donât want to work on scala, then you can simply close all scala projects.
For scala, there are two versions: 2.12 and 2.13. Both share the same code, which is in pmd-scala-modules/pmd-scala-common
. However, this code is not used directly, but referenced from the two projects pmd-scala-moduls/pmd-scala_2.12
and pmd-scala-moduls/pmd-scala_2.13
. When working on scala, it is recommended to close pmd-scala_2.12 and only work on pmd-scala_2.13. Then you need to configure âpmd-scala_2.13â manually, so that eclipse finds the source folders:
pmd-scala-modules/pmd-scala-common/src/main/java
. Name it âsrc-main-javaâ and click âFinishâ.pmd-scala-modules/pmd-scala-common/src/main/resources
. Name it âsrc-main-resourcesâ.pmd-scala-modules/pmd-scala-common/src/test/java
and pmd-scala-modules/pmd-scala-common/src/test/resources
.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4