You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Stein (Jira)" <ji...@apache.org> on 2019/12/01 11:17:00 UTC

[jira] [Comment Edited] (SUREFIRE-1563) NoClassDefFoundError for JPMS modules with "require static"

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

Christian Stein edited comment on SUREFIRE-1563 at 12/1/19 11:16 AM:
---------------------------------------------------------------------

Perhaps, Surefire should support the non-official `module-info.test` file as described here: [https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#white-box-modular-testing-with-extra-java-command-line-options]

It is already adopted by 
 * [https://github.com/sormuras/junit-platform-maven-plugin#module-infotest-support]
 * [https://github.com/java9-modularity/gradle-modules-plugin#how-does-it-work]

IntelliJ IDEA is about to support it as well, maybe:
 * [https://youtrack.jetbrains.com/issue/IDEA-222831]

 

Btw. since 2019.3, IDEA supports running tests on the module path out of the box: [https://youtrack.jetbrains.com/issue/IDEA-171419]


was (Author: sor):
Perhaps, Surefire should support the non-official `module-info.test` file as described here: [https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#white-box-modular-testing-with-extra-java-command-line-options]

It is already adopted by 
 * [https://github.com/sormuras/junit-platform-maven-plugin#module-infotest-support]
 * [https://github.com/java9-modularity/gradle-modules-plugin#how-does-it-work]

> 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
(v8.3.4#803005)