-1

We are looking for an option in flex-pmd-maven-plugin to skip the pmd execution temporarily using a command-line option. The maven pmd plugin has a -Dpmd.skip=true option.

I am looking for a similar kind of thing for flex-pmd-maven-plugin too.

        <plugin>
            <groupId>com.adobe.ac</groupId> 
            <artifactId>flex-pmd-maven-plugin</artifactId> 
            <version>${flex-pmd.version}</version> 
            <executions>
                <execution>
                    <phase>package</phase> 
                    <goals>
                        <goal>check</goal> 
                    </goals>
                </execution>
            </executions>
            <configuration>
                <ruleSet>build_rules/Flexpmd.xml</ruleSet> 
                <excludePackage>**/Mocked*.as</excludePackage>
            </configuration>
        </plugin>

I had a look at the source code for the plugin and there seems to be no option to do that. Any ideas or a work around on this is welcome..

  • Skipping a maven goal is generally a pretty standard option that many plugins provide. Also please let me know if there is a way where we can raise enhancement requests if such an option is not available already with this plugin – codemaniac Mar 05 '13 at 19:35

1 Answers1

0

I found a workaround to skipping the Flex PMD without having to actually remove the plugin. The flex-pmd plugin runs in the verify maven phase. I got the phase in the plugin parameterized as and passed a command line argument -Dpmd.phase as either deploy or package.

An then I then ran the command

mvn clean install -Dpmd.phase=deploy

Since maven runs only until install phase and the pmd phase is changed to deploy, the Flex PMD is skipped.. :)

When I want to run the Flex PMD, I just change the hudson build to run the following

mvn clean install -Dpmd.phase=package 

Here the code snippet

         <plugin>
            <groupId>com.adobe.ac</groupId> 
            <artifactId>flex-pmd-maven-plugin</artifactId> 
            <version>${flex-pmd.version}</version> 
            <executions>
                <execution>
                    <phase>${pmd.phase}</phase> 
                    <goals>
                        <goal>check</goal> 
                    </goals>
                </execution>
            </executions>
            <configuration>
                <ruleSet>build_rules/Flexpmd.xml</ruleSet> 
                <excludePackage>**/Mocked*.as</excludePackage>
            </configuration>
        </plugin>

I have also the following default property in the pom so that pmd will run by default for developers who run the normal mvn clean install

<properties>
   <pmd.phase>package</pmd.phase>
</properties>