How to add PMD to maven ?

  • Thread starter comp.lang.java.programmer
  • Start date
C

comp.lang.java.programmer

Anyone generated reports using PMD?
If you did, then pl. give me the steps/ examples to add PMD plugin to
maven.

I couldn't find proper documentation from web. Any sample pom.xml will
help.
 
G

Greg R. Broderick

Anyone generated reports using PMD?
If you did, then pl. give me the steps/ examples to add PMD plugin to
maven.

I'd suggest that you might get a better and faster response, if you posted
your query to the SourceForge forums for PMD. They're at
<http://sourceforge.net/forum/?group_id=56262>.

Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 
C

comp.lang.java.programmer

I added the PMD to maven.

Here is the entry I added to pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>

I am getting the following error while running the script.

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'pmd'.
[INFO]
--------------------------------------------------------------------
----
[ERROR] BUILD ERROR
[INFO]
--------------------------------------------------------------------
----
[INFO] The plugin 'org.apache.maven.plugins:maven-pmd-plugin' does not
exis
t or no valid version could be found
[INFO]
--------------------------------------------------------------------
 
A

Alexander Shvets

comp.lang.java.programmer said:
I added the PMD to maven.

Here is the entry I added to pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>

I am getting the following error while running the script.

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'pmd'.
[INFO]
--------------------------------------------------------------------
----
[ERROR] BUILD ERROR
[INFO]
--------------------------------------------------------------------
----
[INFO] The plugin 'org.apache.maven.plugins:maven-pmd-plugin' does not
exis
t or no valid version could be found
[INFO]

it means that your default repository does not have this artifact. Maybe
you have to specify repository location explicitly.

At this location:

http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-pmd-plugin/

there are few versions.

Pick one of them. In your pom.xml file you can add

<repositories>
<repository>
<id>central1</id>
<name>Central Repository 1</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>

or some other location.

Alexander.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top