maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alix Lourme (JIRA)" <j...@codehaus.org>
Subject [jira] (MPMD-204) CPD report : Required class was missing : org/w3c/dom/ElementTraversal
Date Tue, 10 Feb 2015 10:59:23 GMT

    [ https://jira.codehaus.org/browse/MPMD-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=362949#comment-362949
] 

Alix Lourme commented on MPMD-204:
----------------------------------

+More information+ : 
* pmd-core +doesn't use+ xercesImpl as dependency => The _parser_ loaded in _XMLRenderer.createDocument_
(unit test, ...) is : *com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl* (from
JRE)
* pmd-java uses xercesImpl as dependency => The _parser_ loaded by _XMLRenderer.createDocument_
is *org.apache.xerces.jaxp.DocumentBuilderImpl*. 

And for me some unit test are fail in pmd-java (Eclipse or maven). Deleting xercesImpl dependency,
all is ok.

+Root cause+ : [pmd-java 5.2.3|http://search.maven.org/#artifactdetails|net.sourceforge.pmd|pmd-java|5.2.3|jar]
use xercesImpl dependency without version => last one used (2.11.0), without xml-apis =>
fail.

> CPD report : Required class was missing : org/w3c/dom/ElementTraversal
> ----------------------------------------------------------------------
>
>                 Key: MPMD-204
>                 URL: https://jira.codehaus.org/browse/MPMD-204
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>          Components: CPD
>    Affects Versions: 3.3, 3.4
>         Environment: Maven 3.2.3
>            Reporter: Alix Lourme
>         Attachments: site-plexus-classpath.log
>
>
> Hi, 
> Since _maven-pmd-plugin_ v3.3, on a simple pom : 
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project...>
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>test</groupId>
>     <artifactId>test</artifactId>
>     <version>1.0.0-SNAPSHOT</version>
>     <packaging>jar</packaging>
>     <reporting>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-pmd-plugin</artifactId>
>                 <version>3.4</version>
>             </plugin>
>         </plugins>
>     </reporting>
> </project>
> {code}
> Command _mvn site_ gives : 
> {quote}
> Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing
while executing org.apache.maven.plugins:maven-site-plugin:3.3:site: org/w3c/dom/ElementTraversal
> {quote}
> Stack : 
> {code}
> Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	[...]
> 	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
> 	at org.apache.xerces.jaxp.DocumentBuilderImpl.newDocument(Unknown Source)
> 	at net.sourceforge.pmd.cpd.XMLRenderer.createDocument(XMLRenderer.java:50)
> 	at net.sourceforge.pmd.cpd.XMLRenderer.render(XMLRenderer.java:73)
> 	at org.apache.maven.plugin.pmd.CpdReport.writeNonHtml(CpdReport.java:301)
> 	at org.apache.maven.plugin.pmd.CpdReport.executeCpd(CpdReport.java:260)
> 	at org.apache.maven.plugin.pmd.CpdReport.executeCpdWithClassloader(CpdReport.java:195)
> 	at org.apache.maven.plugin.pmd.CpdReport.canGenerateReport(CpdReport.java:170)
> 	[...]
> 	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:121)
> 	[...]
> Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
> 	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
> 	[...]
> 	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
> 	[...]
> {code}
> ----
> Adding this override fix the problem, but could introduce some impacts on other report
plugins :
> {code:xml}
> <build>
>         <pluginManagement>
>             <plugins>
>                 <plugin>
>                     <groupId>org.apache.maven.plugins</groupId>
>                     <artifactId>maven-site-plugin</artifactId>
>                     <version>3.4</version>
>                     <dependencies>
>                         <dependency>
>                             <groupId>xml-apis</groupId>
>                             <artifactId>xml-apis</artifactId>
>                             <version>1.4.01</version>
>                         </dependency>
>                     </dependencies>
>                 </plugin>
>             </plugins>
>         </pluginManagement>
>     </build>
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message