Skip to main content
Participating Frequently
October 2, 2009
Question

Maven : Configuration ruleSet

  • October 2, 2009
  • 2 replies
  • 3824 views

Hi all!

When we launch flexpmd from the plugin maven, how could we indicate our xml rule file?


Indeed actually I run the plugin FlexPMD declared in my pom like this:

            <plugin>
                <groupId>com.adobe.ac</groupId>
                <artifactId>flex-pmd-maven-plugin</artifactId>
                <version>1.0.RC4</version>
            </plugin>

But it takes by defaults all the rules. I have tried to configure my pom (like it did with ant) bya adding a configuration section where i specify my xml rule file.

            <plugin>
                <groupId>com.adobe.ac</groupId>
                <artifactId>flex-pmd-maven-plugin</artifactId>
                <version>1.0.RC4</version>
                <configuration>
                    <ruleSet>pluginConfig/flexpmd.xml</ruleSet>
                </configuration>
            </plugin>

This fails unfortunatly

igreek

This topic has been closed for replies.

2 replies

Adobe Employee
October 7, 2009

Hi!

First of all, thanks for spotting this one down. Feel free to create a new defect and attach the patch to it. I will integrate it in the next release candidate.

About the final keyword, I see your point. I am not sure which one you are talking about, but final makes sense in a lot of places.

It may makes sense to remove it for specific methods.

Best

Xavier

Participant
March 3, 2010

Hi everyone

I faced with the same problem.

My FlexPmd.xml file is part of another project (myxxx-build-tools).

Project that I'm trying to launch has dependecy to the project with FlexPmd.xml:

<dependency>

            <groupId>com.xxx.xx</groupId>

            <artifactId>myxxx-build-tools</artifactId>

            <version>1.0-SNAPSHOT</version>

        </dependency>

Also from tutorial I put:

<reporting>

        <plugins>

            <plugin>

                <groupId>com.adobe.ac</groupId>

                <artifactId>flex-pmd-maven-plugin</artifactId>

                <version>1.0.RC5</version>

                <configuration>

                    <ruleSet>myxxx-build-tools/FlexPmd.xml</ruleSet>

                </configuration>

                <reportSets>

                </reportSets>

            </plugin>

        </plugins>

    </reporting>

When I'm trying to run mvn site plugin can't resolve path to my custom ruleset.

What I'm doing wrong, or could anyone give me some example of pom.xml files when custom ruleset belong to another project.

Thanks.

Adobe Employee
October 5, 2009

Can you send the console log, please?

Xavier

igreekAuthor
Participating Frequently
October 5, 2009

Hi Xavier,

Here is the log of the error encountered:

[INFO] Generating "Flex PMD Report" report.
5 oct. 2009 13:56:57 com.adobe.ac.pmd.maven.AbstractFlexPmdMojo executeReport
INFO: FlexPmdMojo starts
5 oct. 2009 13:56:57 com.adobe.ac.pmd.engines.AbstractFlexPmdEngine <init>
ATTENTION: E:\TestFlexPMD\UnitedRetail_Product\ProductCodification\pluginConfig\
flexpmd.xml
(Le chemin d'accÞs spÚcifiÚ est introuvable) at java.io.FileInputStr
eam.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:106)
com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.loadRuleset(AbstractFlexPmdEngine
.java:180)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during page generation

Embedded error: Error rendering Maven report: A system exception has been thrown

FlexPMD is trying to search the ruleSet configuration file flexpmd.xml in the wrong directory.

I'm using a relative path for the location of the ruleSet file by incorporing this file in a project build-tools (which is specified in the parent pom of my project as an extension). Itworks with my other quality tools (checkstyle, pmd java, etc.).

I tried to change the relative path by an absolute path and it works fine (but it is not what I really want).

            <plugin>
                <groupId>com.adobe.ac</groupId>
                <artifactId>flex-pmd-maven-plugin</artifactId>
                <version>1.0.RC4</version>
                <configuration>
                    <ruleSet>E:/pmd_all_rules.xml</ruleSet>       
                </configuration>
            </plugin>

Thanks for your reply

Adobe Employee
October 5, 2009

Hi,

Can you try to use ${baseDir}/custom_ruleset.xml ?

Xavier