apache / apache/maven-surefire

[SUREFIRE-1563] NoClassDefFoundError for JPMS modules with "require static"

Open
#2,147 51 comments 0 reactions 1 assignee Claimed by @olamy View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Simone Bordet](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=sbordet)** opened **[SUREFIRE-1563](https://issues.apache.org/jira/browse/SUREFIRE-1563?redirect=false)** and commented

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.

---

**Affects:** 2.22.0

**Attachments:**
- [maven-jpms.tgz](https://issues.apache.org/jira/secure/attachment/12937474/maven-jpms.tgz) (_1.92 kB_)

**Issue Links:**
- [SUREFIRE-1667](https://issues.apache.org/jira/browse/SUREFIRE-1667) Crash with JPMS "requires static"
(_**"is duplicated by"**_)

1 votes, 11 watchers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.