You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2012/01/25 22:16:02 UTC

[jira] (MPMD-94) Ignores ruleset in multiproject build

     [ https://jira.codehaus.org/browse/MPMD-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg closed MPMD-94.
-------------------------------

    Resolution: Incomplete
    
> Ignores ruleset in multiproject build
> -------------------------------------
>
>                 Key: MPMD-94
>                 URL: https://jira.codehaus.org/browse/MPMD-94
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_11
> OS name: "linux" version: "2.6.24-23-generic" arch: "i386" Family: "unix"
>            Reporter: Charlie Collins
>
> I have several projects that use a custom ruleset file and work perfectly fine on their own.  Once added as modules to a multiproject build however, the pmd:check goal fails these projects using rules that are NOT IN my custom ruleset - appears to ignore the ruleset in multiproject build.
> ----
> Standard single Maven project:
> {noformat}
> mvn -X pmd:check
> . . . .
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-pmd-plugin:2.4:pmd' -->
> [DEBUG]   (f) aggregate = false
> [DEBUG]   (f) compileSourceRoots = [/data/ccollins/projects/axioma-model/src/main/java]
> [DEBUG]   (f) excludes = [Ljava.lang.String;@118fa47
> [DEBUG]   (f) format = xml
> [DEBUG]   (f) includeTests = false
> [DEBUG]   (f) linkXRef = true
> [DEBUG]   (f) minimumPriority = 5
> [DEBUG]   (f) outputDirectory = /data/ccollins/projects/axioma-model/target/site
> [DEBUG]   (f) project = MavenProject: com.axiomainc:axioma-model:0.3-SNAPSHOT @ /data/ccollins/projects/axioma-model/pom.xml
> [DEBUG]   (f) reactorProjects = [MavenProject: com.axiomainc:axioma-model:0.3-SNAPSHOT @ /data/ccollins/projects/axioma-model/pom.xml]
> [DEBUG]   (s) rulesets = [Ljava.lang.String;@1dee400
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) targetDirectory = /data/ccollins/projects/axioma-model/target
> [DEBUG]   (f) targetJdk = 1.5
> [DEBUG]   (f) testSourceRoots = [/data/ccollins/projects/axioma-model/src/test/java]
> [DEBUG]   (f) xrefLocation = /data/ccollins/projects/axioma-model/target/site/xref
> [DEBUG]   (f) xrefTestLocation = /data/ccollins/projects/axioma-model/target/site/xref-test
> [DEBUG] -- end configuration --
> [INFO] [pmd:pmd]
> [DEBUG] Preparing ruleset: /data/ccollins/projects/axioma-model/standards/AxiomaPMDConfig-Strict.xml
> [DEBUG] Before: /data/ccollins/projects/axioma-model/standards/AxiomaPMDConfig-Strict.xml After: AxiomaPMDConfig-Strict.xml
> [DEBUG] Exclusions: **/*~,**/#*#,**/.#*,**/%*%,**/._*,**/CVS,**/CVS/**,**/.cvsignore,**/SCCS,**/SCCS/**,**/vssver.scc,**/.svn,**/.svn/**,**/.arch-ids,**/.arch-ids/**,**/.bzr,**/.bzr/**,**/.MySCMServerInfo,**/.DS_Store,**/*Example.*
> [DEBUG] Inclusions: **/*.java
> [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-pmd-plugin:2.4:check' -->
> [DEBUG]   (f) aggregate = false
> [DEBUG]   (f) failOnViolation = true
> [DEBUG]   (f) failurePriority = 5
> [DEBUG]   (f) language = java
> [DEBUG]   (f) project = MavenProject: com.axiomainc:axioma-model:0.3-SNAPSHOT @ /data/ccollins/projects/axioma-model/pom.xml
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) targetDirectory = /data/ccollins/projects/axioma-model/target
> [DEBUG]   (f) verbose = true
> [DEBUG] -- end configuration --
> [INFO] [pmd:check]
> [INFO] 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Fri Feb 20 13:12:03 EST 2009
> [INFO] Final Memory: 7M/82M
> [INFO] ------------------------------------------------------------------------
> {noformat}
> ----
> Simple multi module project WITH ONLY ONE MODULE - the same project as the previous example that works:
> {noformat}
>  mvn -X clean pmd:check
> . . . .
> [DEBUG]   (f) reactorProjects = [MavenProject: com.axiomainc:axioma-common-utils:0.3-SNAPSHOT @ /data/ccollins/projects/axioma-common-utils/pom.xml, MavenProject: com.axiomainc:PanaceaMultiproject:1.0-SNAPSHOT @ /data/ccollins/projects/axioma-PanaceaMultiProject/pom.xml]
> [DEBUG]   (s) rulesets = [Ljava.lang.String;@8f9a32
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) targetDirectory = /data/ccollins/projects/axioma-common-utils/target
> [DEBUG]   (f) targetJdk = 1.5
> [DEBUG]   (f) testSourceRoots = [/data/ccollins/projects/axioma-common-utils/src/test/java]
> [DEBUG]   (f) xrefLocation = /data/ccollins/projects/axioma-common-utils/target/site/xref
> [DEBUG]   (f) xrefTestLocation = /data/ccollins/projects/axioma-common-utils/target/site/xref-test
> [DEBUG] -- end configuration --
> [INFO] [pmd:pmd]
> [DEBUG] Preparing ruleset: /data/ccollins/projects/axioma-common-utils/standards/AxiomaPMDConfig-Strict.xml
> [DEBUG] Before: /data/ccollins/projects/axioma-common-utils/standards/AxiomaPMDConfig-Strict.xml After: AxiomaPMDConfig-Strict.xml
> [DEBUG] Exclusions: **/*~,**/#*#,**/.#*,**/%*%,**/._*,**/CVS,**/CVS/**,**/.cvsignore,**/SCCS,**/SCCS/**,**/vssver.scc,**/.svn,**/.svn/**,**/.arch-ids,**/.arch-ids/**,**/.bzr,**/.bzr/**,**/.MySCMServerInfo,**/.DS_Store,**/*generated*/**
> [DEBUG] Inclusions: **/*.java
> [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-pmd-plugin:2.4:check' -->
> [DEBUG]   (f) aggregate = false
> [DEBUG]   (f) failOnViolation = true
> [DEBUG]   (f) failurePriority = 5
> [DEBUG]   (f) language = java
> [DEBUG]   (f) project = MavenProject: com.axiomainc:axioma-common-utils:0.3-SNAPSHOT @ /data/ccollins/projects/axioma-common-utils/pom.xml
> [DEBUG]   (f) skip = false
> [DEBUG]   (f) targetDirectory = /data/ccollins/projects/axioma-common-utils/target
> [DEBUG]   (f) verbose = true
> [DEBUG] -- end configuration --
> [INFO] [pmd:check]
> [INFO] PMD Failure: com.axiomainc.utils.DateHelper:61 Rule:DataflowAnomalyAnalysis Priority:5 Found 'DD'-anomaly for variable 'result' (lines '61'-'63')..
> [INFO] PMD Failure: com.axiomainc.utils.DateHelper:77 Rule:DataflowAnomalyAnalysis Priority:5 Found 'DD'-anomaly for variable 'result' (lines '77'-'79')..
> [INFO] PMD Failure: com.axiomainc.utils.DateHelper:93 Rule:DataflowAnomalyAnalysis Priority:5 Found 'DD'-anomaly for variable 'result' (lines '93'-'95')..
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] You have 3 PMD violations. For more details see:/data/ccollins/projects/axioma-common-utils/target/pmd.xml
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.BuildFailureException: You have 3 PMD violations. For more details see:/data/ccollins/projects/axioma-common-utils/target/pmd.xml
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> 	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> 	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> 	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoFailureException: You have 3 PMD violations. For more details see:/data/ccollins/projects/axioma-common-utils/target/pmd.xml
> 	at org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo.executeCheck(AbstractPmdViolationCheckMojo.java:138)
> 	at org.apache.maven.plugin.pmd.PmdViolationCheckMojo.execute(PmdViolationCheckMojo.java:69)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
> 	... 16 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Fri Feb 20 13:05:32 EST 2009
> [INFO] Final Memory: 11M/83M
> [INFO] ------------------------------------------------------------------------
> {noformat}
> The ":DataflowAnomalyAnalysis" rule is not present in my ruleset. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira