[
https://jira.codehaus.org/browse/MNG-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=298834#comment-298834
]
Roman Arkadijovych Muntyanu commented on MNG-4476:
--------------------------------------------------
Hello Benjamin,
Just to clarify.
Did you mean that for plug-ins invoked from the CLI or during the build
lifecycle <build>/<pluginManagement>/<plugins> is not allowed and
<build>/<plugins> should be used instead? How should configuration inheritance
be organized in such case?
> [regression] reporting configuration does not apply to plugins invoked from
> CLI
> -------------------------------------------------------------------------------
>
> Key: MNG-4476
> URL: https://jira.codehaus.org/browse/MNG-4476
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Plugins and Lifecycle
> Affects Versions: 3.0-alpha-3, 3.0-alpha-4, 3.0-alpha-5
> Environment: Vista
> Reporter: Fred Bricon
> Assignee: Benjamin Bentmann
> Attachments: pom.zip
>
>
> Using Maven 3 alphas (3,4,5), PMD configuration is not herited from the
> parent pom to its modules.
> Here is the parent pom :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>foo.bar.pmd</groupId>
> <artifactId>pom</artifactId>
> <packaging>pom</packaging>
> <name>Parent project</name>
> <version>0.0.1-SNAPSHOT</version>
> <build>
> <pluginManagement>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>${java.version}</source>
> <target>${java.version}</target>
> <showWarnings>true</showWarnings>
> </configuration>
> </plugin>
> </plugins>
> </pluginManagement>
> </build>
> <reporting>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-pmd-plugin</artifactId>
> <version>2.4</version>
> <configuration>
> <targetJdk>${java.version}</targetJdk>
> </configuration>
> </plugin>
> </plugins>
> </reporting>
> <properties>
> <java.version>1.5</java.version>
> </properties>
> <modules>
> <module>jar</module>
> </modules>
> </project>{code}
> the child module
> {code}
> <?xml version="1.0"?>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd"
> xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <artifactId>pom</artifactId>
> <groupId>foo.bar.pmd</groupId>
> <version>0.0.1-SNAPSHOT</version>
> <relativePath>..\pom.xml</relativePath>
> </parent>
> <groupId>foo.bar.pmd</groupId>
> <artifactId>jar</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <name>jar</name>
> </project>
> {code}
> The analyzed source file
> {code}
> package foo.bar.pmd;
> /**
> * Hello world!
> *
> */
> @SuppressWarnings("PMD")
> public class App
> {
> public static void main( String[] args )
> {
> System.out.println( "Hello World!" );
> }
> }
> {code}
> This is the outpout of *mvn pmd:pmd*
> {code}
> D:\Projets\pom>mvn pmd:pmd
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Build Order:
> [INFO]
> [INFO] Parent project
> [INFO] jar
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Parent project 0.0.1-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-pmd-plugin:2.4:pmd (default-cli) @ pom ---
> [WARNING] Unable to locate Source XRef to link to - DISABLED
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building jar 0.0.1-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-pmd-plugin:2.4:pmd (default-cli) @ jar ---
> [WARNING] Unable to locate Source XRef to link to - DISABLED
> [WARNING] File encoding has not been set, using platform encoding Cp1252,
> i.e. b
> uild is platform dependent!
> [WARNING] Error while parsing
> D:\Projets\pom\jar\src\main\java\foo\bar\pmd\App.j
> ava: Can't use annotations when running in JDK 1.4 mode!
> [WARNING] Error while parsing
> D:\Projets\pom\jar\src\main\java\foo\bar\pmd\App.j
> ava: Can't use annotations when running in JDK 1.4 mode!
> [WARNING] Error while parsing
> D:\Projets\pom\jar\src\main\java\foo\bar\pmd\App.j
> ava: Can't use annotations when running in JDK 1.4 mode!
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Parent project .................................... SUCCESS [0.789s]
> [INFO] jar ............................................... SUCCESS [0.151s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1.532s
> [INFO] Finished at: Tue Dec 01 10:28:59 CET 2009
> [INFO] Final Memory: 5M/11M
> [INFO]
> ------------------------------------------------------------------------
> {code}
> Using Maven 2.2.1, I have :
> {code}
> D:\Projets\pom>mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.6.0_12
> Java home: D:\Dev\Java\jdk1.6.0_12\jre
> Default locale: fr_FR, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"
> D:\Projets\pom>mvn pmd:pmd
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO] Parent project
> [INFO] jar
> [INFO] Searching repository for plugin with prefix: 'pmd'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Parent project
> [INFO] task-segment: [pmd:pmd]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [pmd:pmd {execution: default-cli}]
> [WARNING] Unable to locate Source XRef to link to - DISABLED
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building jar
> [INFO] task-segment: [pmd:pmd]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [pmd:pmd {execution: default-cli}]
> [WARNING] Unable to locate Source XRef to link to - DISABLED
> [WARNING] File encoding has not been set, using platform encoding Cp1252,
> i.e. b
> uild is platform dependent!
> [INFO]
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Parent project ........................................ SUCCESS
> [1.544s]
> [INFO] jar ................................................... SUCCESS
> [0.276s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Tue Dec 01 10:31:59 CET 2009
> [INFO] Final Memory: 5M/10M
> [INFO]
> ------------------------------------------------------------------------
> {code}
> Attached is a test project demonstrating the problem.
> regards,
> Fred Bricon
--
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