A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pmd-code.org/latest/pmd_devdocs_building_eclipse.html below:

Building PMD with Eclipse | PMD Source Code Analyzer

Table of Contents Import PMD Project
  1. Download the latest Eclipse IDE for Enterprise Java and Web Developers
  2. Install it by extracting it into a directory of your choice
  3. Start 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.
  4. Close the welcome screen, if it is shown.
  5. Select menu File, Import.... In the dialog, select Maven / Existing Maven Projects and click Next.
  6. As Root Directory select the directory, into which PMD’s repository has been cloned.
  7. Then click 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 tests

To 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 PMD Code Templates, Formatter
  1. Menu Window -> Preferences
  2. Under Java / Code Style / Code Templates: Click Import... and choose the file eclipse/pmd-eclipse-codetemplates.xml from the “build-tools” repository.
  3. Under Java / Code Style / Formatter: Click Import... and choose the file eclipse/pmd-eclipse-code-formatter.xml from the “build-tools” repository.
  4. Under Java / Code Style / Clean Up: Click Import... and choose the file eclipse/pmd-eclipse-code-cleanup.xml from the “build-tools” repository.
  5. Under Java / Code Style / Organize Imports: Click Import... and choose the file eclipse/pmd-eclipse-imports.importorder from the build-tools” repository.
  6. Click Apply and Close
Checkstyle

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.

  1. Menu Help, Install New Software...
  2. Enter the URL https://checkstyle.org/eclipse-cs-update-site into the text field and press enter.
  3. Select the checkbox for “Checkstyle” and click Next
  4. Restart eclipse if you are requested to do so.
  5. Install the next plugin for the URL https://m2e-code-quality.github.io/m2e-code-quality-p2-site/
  6. This time, select only “Checkstyle configuration plugin for M2Eclipse” and click Next
  7. Restart eclipse if you are requested to do so.
  8. Finally, right click on one project in the package explorer. Select Maven / Update project... in the context menu. In the dialog, select all projects, unselect the option “Clean projects” and click OK.
Other settings Running the designer

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.

Known Issues

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