[
https://issues.apache.org/jira/browse/SUREFIRE-1563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16598323#comment-16598323
]
Christian Stein commented on SUREFIRE-1563:
-------------------------------------------
[~sbordet] - I can confirm that Surefire works with the following configuration
{{ <plugin>}}
{{ <artifactId>maven-surefire-plugin</artifactId>}}
{{ <version>2.22.0</version>}}
{{ <configuration>}}
{{ <argLine>--add-modules=ALL-MODULE-PATH</argLine> // without "@\{argLine}"}}
{{ </configuration>}}
{{ </plugin>}}
[~rfscholte] - It should be up to the test designer to make that choice.
Surefire should not add all statically required modules via `--add-modules` by
default. What if you want to test your code handling the case when the module
is not present at runtime?
> NoClassDefFoundError for JPMS modules with "require static"
> -----------------------------------------------------------
>
> Key: SUREFIRE-1563
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1563
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Affects Versions: 2.22.0
> Reporter: Simone Bordet
> Priority: Major
> Attachments: maven-jpms.tgz
>
>
> When a Maven module has a {{module-info.java}} that contains a {{requires
> static}}, Surefire throws {{NoClassDefFoundError}} when running the tests for
> that Maven module.
> If the dependency is declared only as {{required}} (no {{static}}), then the
> tests run fine.
> Attached a reproducible project.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)