You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2017/09/28 19:49:00 UTC

[jira] [Commented] (MENFORCER-283) Java 9 banDuplicateClasses incorrectly sees module-info.class as duplicate

    [ https://issues.apache.org/jira/browse/MENFORCER-283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16184736#comment-16184736 ] 

Robert Scholte commented on MENFORCER-283:
------------------------------------------

I agree, and we should probably include descriptors in multi-release jars as well, i.e. {{META-INF/versions/N/module-info.class}}

> Java 9 banDuplicateClasses incorrectly sees module-info.class as duplicate
> --------------------------------------------------------------------------
>
>                 Key: MENFORCER-283
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-283
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.4.1
>            Reporter: Sven Haster
>            Priority: Minor
>
> When running the enforcer plugin with banDuplicateClasses rule against a project with dependencies on java-9 compatible libraries which include a module-info.class file, the plugin sees the multiple module-info files as duplicate classes. 
> It should simply ignore these similar to package-info.
> In our projects, it is the dependencies on multiple libs from org.ow2.asm which provides the module-info class, rendering the following output:
> {noformat}
> [WARNING] Rule 2: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message:
> Duplicate classes found:
>   Found in:
>     org.ow2.asm:asm-tree:jar:6.0:compile
>     org.ow2.asm:asm:jar:6.0:compile
>     org.ow2.asm:asm-util:jar:6.0:compile
>   Duplicate classes:
>     module-info.class
> {noformat}
> We can easily work around this problem for now by adding a global rule to ignore module-info such as the following but it would be nice if the enforces plugin ignored this file by default.
> {code:xml}
> <banDuplicateClasses>
> 	<ignoreClasses>
> 		<ignoreClass>module-info</ignoreClass>
> 	</ignoreClasses>
> </banDuplicateClasses>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)