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

Robert Scholte commented on MCOMPILER-329:
------------------------------------------

When running this project, Maven starts with the following message:

{noformat}
[WARNING]
[WARNING] Some problems were encountered while building the effective model for 
org.joda:maven-issue1:jar:0.1
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: com.google.guava:guava:jar -> duplicate declaration of version 
24.0-jre @ line 93, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
[WARNING]
{noformat}

This project exposes that stability-issue. Every unique Maven dependency can 
have only one scope and one value for optional. It is required at compile time, 
so you should remove the declaration where the scope is reduced to test.
That change will result is successful compilations of the main and test 
classes, but will result in failure by surefire. I believe focus should be 
there.


> Compile fails with optional and scope test sections with JPMS modules
> ---------------------------------------------------------------------
>
>                 Key: MCOMPILER-329
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-329
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.7.0
>         Environment: Windows 10, Maven v3.5.2
>            Reporter: Stephen Colebourne
>            Priority: Major
>         Attachments: maven-issue2.zip
>
>
> Attached is a simple project that demonstrates this bug. The pom.xml has one 
> significant dependency - Guava, an automatic module.
> The same dependency is added twice - once declared optional and once declared 
> as scope=test. In addition, the module-info declares the dependency using 
> `requires static`.
> The duplicate dependency causes the plugin problems determining the 
> modulepath, as the result is the error "module not found". It isn't clear 
> whether the module isn't being added to the modulepath or whether it is there 
> and not being seen.
> While this may be an odd setup, it greatly complicated finding SUREFIRE-1501



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to