You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "David Vana (JIRA)" <ji...@codehaus.org> on 2010/03/02 17:11:55 UTC

[jira] Created: (MPMD-116) Methods Rule.start and Rule.end are not executed

Methods Rule.start and Rule.end are not executed
------------------------------------------------

                 Key: MPMD-116
                 URL: http://jira.codehaus.org/browse/MPMD-116
             Project: Maven 2.x PMD Plugin
          Issue Type: Bug
          Components: PMD
    Affects Versions: 2.4
         Environment: Windows XP
Maven 2.2.1
            Reporter: David Vana


Methods start() and end() from interface Rule are not executed when running pmd as a mvn pluggin.

{code:title=SomeCustomRule.java|borderStyle=solid}

public class SomeCustomRule extends AbstractJavaRule {

public void start(RuleContext ctx) {
  System.out.println("START");
}

public void end(RuleContext ctx) {
  System.out.println("END");
}
{code}

{code:xml|title=pom.xml|borderStyle=solid}
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <targetJdk>1.6</targetJdk>
                <rulesets>
                    <ruleset>some_custom_ruleset.xml</ruleset>
                </rulesets>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>sandbox</groupId>
                    <artifactId>some_custom_ruleset</artifactId>
                    <version>1.0</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
{code}

{code:xml|title=some_custom_ruleset.xml|borderStyle=solid}
<ruleset>
    <description>Some custom ruleset.</description>
    <rule name="SomeCustomRule"
          message="Testing rule."
          class="SomeCustomRule">
        <description>
            Testing rule.
        </description>
        <priority>3</priority>

        <example>
            <![CDATA[
        ]]>
        </example>
    </rule>
</ruleset>
{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MPMD-116) Methods Rule.start and Rule.end are not executed

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPMD-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy closed MPMD-116.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
         Assignee: Herve Boutemy

done in r939821.

> Methods Rule.start and Rule.end are not executed
> ------------------------------------------------
>
>                 Key: MPMD-116
>                 URL: http://jira.codehaus.org/browse/MPMD-116
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: Windows XP
> Maven 2.2.1
>            Reporter: David Vana
>            Assignee: Herve Boutemy
>             Fix For: 2.5
>
>
> Methods start() and end() from interface Rule are not executed when running pmd as a mvn pluggin.
> {code:title=SomeCustomRule.java|borderStyle=solid}
> public class SomeCustomRule extends AbstractJavaRule {
> public void start(RuleContext ctx) {
>   System.out.println("START");
> }
> public void end(RuleContext ctx) {
>   System.out.println("END");
> }
> {code}
> {code:xml|title=pom.xml|borderStyle=solid}
> <build>
>     <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-pmd-plugin</artifactId>
>             <version>2.4</version>
>             <configuration>
>                 <targetJdk>1.6</targetJdk>
>                 <rulesets>
>                     <ruleset>some_custom_ruleset.xml</ruleset>
>                 </rulesets>
>             </configuration>
>             <dependencies>
>                 <dependency>
>                     <groupId>sandbox</groupId>
>                     <artifactId>some_custom_ruleset</artifactId>
>                     <version>1.0</version>
>                 </dependency>
>             </dependencies>
>         </plugin>
>     </plugins>
> </build>
> {code}
> {code:xml|title=some_custom_ruleset.xml|borderStyle=solid}
> <ruleset>
>     <description>Some custom ruleset.</description>
>     <rule name="SomeCustomRule"
>           message="Testing rule."
>           class="SomeCustomRule">
>         <description>
>             Testing rule.
>         </description>
>         <priority>3</priority>
>         <example>
>             <![CDATA[
>         ]]>
>         </example>
>     </rule>
> </ruleset>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira