Maven Report Plugin Integration

I need to configure Maven plugins. I downloaded the JAR. Can someone please tell me what should I do next to integrate or configure plugins with Maven? Should I copy the JAR to the parent directory or do I need to edit any file?

Plugins

  • Java2HTML
  • Jepend
  • Checkstyle
  • Clover
  • Cobertura
  • EMMA
  • Findbugs
  • JavaNCSS
  • PMD
  • QALab
  • Xradar
  • Sonar
+5
source share
3 answers

Maven , ( , , ). POM, Maven , . mvn-.

, , , POM, ( , , ):

<reporting>
  <plugins>
    <plugin>
      <artifactId>maven-checkstyle-plugin</artifactId>
    </plugin>
    <plugin>
      <artifactId>maven-pmd-plugin</artifactId>
      <configuration>
        <linkXref>true</linkXref>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      <version>2.1</version>
      <configuration>
        <formats>
          <format>html</format>
          <format>xml</format>
        </formats>
        <outputDirectory>target/site/cobertura</outputDirectory>
      </configuration>
    </plugin>
    <plugin>
      <artifactId>maven-surefire-report-plugin</artifactId>
      <configuration>
        <outputDirectory>${basedir}/target/surefire-reports</outputDirectory>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>jdepend-maven-plugin</artifactId>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>findbugs-maven-plugin</artifactId>
      <configuration>
        <xmlOutput>true</xmlOutput>
        <effort>Max</effort>
      </configuration>
    </plugin>
  </plugins>
</reporting>

Maven: mvn-, " ", mvn site: site, mvn org.apache.maven.plugins: maven-site-plugin: :

Maven , maven-metadata.xml, ( , ) .

-, :

[INFO] The plugin 'org.apache.maven.plugins:maven-site-plugin' does not exist or no valid version could be found

, - Maven.xml( [MVN_HOME]/conf/settings.xml). defualt, :

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>proxyuser</username>
  <password>proxypass</password>
  <host>proxy.host.net</host>
  <port>80</port>
  <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
</proxy>

, , , Maven .

Maven . Maven: The Definitive Guide Sonatype, .

+13

; Maven , .

( ) pom.xml - , , . , , , - Maven .

, http://maven.apache.org/plugins/. ' , http://www.sonatype.com/books/maven-book/reference/

cobertura:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-pmd-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <outputDirectory>${project.build.directory}/pmd</outputDirectory>
        <targetDirectory>${project.build.directory}</targetDirectory>
        <aggregate>true</aggregate>
        <!--  CPD minimum tokens to report on (5 to 10 duplicate lines)    --> 
        <minimumTokens>100</minimumTokens> 
        <minimumPriority>3</minimumPriority>
        <!--  Exclude mock classes     --> 
        <excludes>
        <exclude>**/Mock.*</exclude> 
        <exclude>**/Dummy.*</exclude> 
        <exclude>**/*Mock.java</exclude> 
        <exclude>**/*Dummy.java</exclude> 
        </excludes>
        <includeTests>true</includeTests> 
        <targetJdk>1.5</targetJdk>
        <rulesets>
            <ruleset>pmd_ruleset.xml</ruleset>  
        </rulesets>
    </configuration>
</plugin>
+1

. 100%, , , checkstyle, maven checkstyle

- :

mvn checkstyle:checkstyle

mvn checkstyle:check

edit1: m2 .

edit2: , maven ( pom), . pom.

0

All Articles