question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing opens directive in module descriptor

See original GitHub issue

Problem

Using Pioneer on the module path fails with:

java.lang.reflect.InaccessibleObjectException:
  Unable to make org.junitpioneer.jupiter.IssueExtension() accessible:
  module org.junitpioneer does not "opens org.junitpioneer.jupiter" to module org.junit.platform.commons

when using an extension located in package org.junitpioneer.jupiter.

Possible Solution

Open packages that contain types using JUnit Platform’s reflection support to module org.junit.platform.commons.

  opens org.junitpioneer.jupiter to org.junit.platform.commons;

Work around

Pass --add-opens org.junitpioneer/org.junitpioneer.jupiter=org.junit.platform.commons on the command-line or at the right place of your build tool when

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
scordiocommented, Feb 19, 2022

Wouldn’t it be sufficient to have a separate src/it module, like @sormuras describes it here:

https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world

We use a similar setup in AssertJ (for another purpose: verify what happens with different classpath content) and the main drawback is not being IDE friendly, so maintaining those tests is a bit of a hassle.

We plan to introduce a Maven multi-module project with the next major version and have separate modules for integration testing, automatically detected by the IDE so easier to be maintained.

Something similar (still Maven focused) was also discussed on StackOverflow and Twitter.

The limitations might be strictly connected to the Maven setup (i.e., the maven-invoker-plugin). I am not sure if something similar with Gradle would have the same issues.

1reaction
sormurascommented, Nov 15, 2021

Making IssueExtension, StopwatchExtension, and friends public should also do the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing opens directives in module descriptors #1877 - GitHub
Fix by adding appropriate opens to org.junit.platform.commons directives. Find other places where reflection support from org.junit.platform.
Read more >
java - How to suppress the "requires transitive directive for an ...
After upgrading a Maven project to Java 9 and adding a module descriptor, javac complains about a transitive dependency ...
Read more >
NG8003: No directive found with export - Angular
Angular can't find a directive with {{ PLACEHOLDER }} export name. This is common with a missing import or a missing exportAs on...
Read more >
Java Modules - Jenkov.com
If any required modules are not found at startup, the Java VM reports the missing module and shuts down. Before Java 9 missing...
Read more >
Go Modules Reference - The Go Programming Language
The go command starts by searching the build list for modules with paths ... As of the Go 1.17 release, if the go...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found