1

I have integrated FlexPMD into my pom.xml file but I need to change the phase & goal in which the plugin is run. Currently it runs in the site phase but I need it to run in the test or compile phase. Is this possible?

My plugin code is as follows:

<reporting>
 <plugins>
  <plugin>
   <groupId>com.adobe.ac</groupId>
   <artifactId>flex-pmd-maven-plugin</artifactId>
   <version>1.0.RC4</version>
   <executions>
     <execution>
    <goals>
      <goal>test</goal>
    </goals>
     </execution>
   </executions>
  </plugin>
 </plugins>
</reporting>
Dennis Jaamann
  • 3,547
  • 2
  • 23
  • 42
Ben Johnson
  • 375
  • 2
  • 7

2 Answers2

1

According to the Flex PMD website, the plugin seems to be designed to be run as a report only. Actually, it may have other goals but I couldn't find any information on the them and the web site makes my browser crashes (which is annoying) and http://opensource.adobe.com/svn/opensource/flexpmd/trunk is currently down so I couldn't check the code of the mojos. If you can point me in the right direction, I may provide a better answer.

In all cases, the <reporting> element is not the right place to bind a plugin goal on a build lifecycle phase (this is done in <build> but I don't know what goal to call as explained) and should looks like:

<reporting>
  <plugins>
    <plugin>
      <groupId>com.adobe.ac</groupId>
      <artifactId>flex-pmd-maven-plugin</artifactId>
      <version>1.0.RC4</version>
    </plugin>
  </plugins>
</reporting>
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • Thanks, Pascal. I had a feeling that it was bound to report only. I will probably end up just calling it from an Ant task instead. – Ben Johnson Nov 18 '09 at 19:45
  • Well, to be honest, I don't see what the `FlexPmdAntTask` is offering more. It just produces a `pmd.xml` file. – Pascal Thivent Nov 18 '09 at 20:12
0

You can call it from build or report. Your choice. In the report section, it will build a pmd.html in addition of the pmd.xml

This HTML website is only created with the Maven plugin. Not ANT task.

HTH

Xavier