IntelliJ Flags Split Package but not Maven
Hi All!
I'm wondering if anyone has seen anything like the following. I have tried everything, including rebuilding my workspace various exclusion statements and many other ideas and nothing resolves this issue.
I have a Maven build using 3.8.1 compiler plugin where I include jersey-media-json-jackson like this:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
(The problem occurs with or without the exclusion)
My module-info.java file looks like this:
open module com.telenav.tdk.serialization.jersey.json
{
requires java.ws.rs;
exports com.telenav.tdk.serialization.jersey.json;
}
And the maven dependency:tree output looks like this:
jonathanl-mbp16:jersey-json jonathanl$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.telenav.tdk.serialization:com.telenav.tdk.serialization-jersey-json >--
[INFO] Building TDK Serialization - Jersey JSON 8.1.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ com.telenav.tdk.serialization-jersey-json ---
[INFO] com.telenav.tdk.serialization:com.telenav.tdk.serialization-jersey-json:jar:8.1.1-SNAPSHOT
[INFO] \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.33:compile
[INFO] +- org.glassfish.jersey.core:jersey-common:jar:2.33:compile
[INFO] | +- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.glassfish.hk2.external:jakarta.inject:jar:2.6.1:compile
[INFO] | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO] +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.33:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.3:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.11.3:compile
[INFO] \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.11.3:compile
[INFO] \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.724 s
[INFO] Finished at: 2021-03-16T16:05:49-07:00
[INFO] ------------------------------------------------------------------------
As you can see, jakarta activation is not being included. However, IntelliJ insists that javax.activation is a split package:
If I remove the java.ws.rs requires statement, the error goes away. If I add it back, the error comes back. But, of course, the strange thing is that jakarta-activation is not being included at all according to maven. What's more, Maven builds this with no errors.
Anyone have any ideas about what might be going on?
Thanks!
Jon
Please sign in to leave a comment.
I should have mentioned I'm using latest IntelliJ: 2020.3.3
Are you sure about the version of the IDE? This should have been fixed in 2020.3.2 in the scope of https://youtrack.jetbrains.com/issue/IDEA-235898
As a general troubleshooting step, please remove/rename .idea directory in the project's root and re-import the project.
Hi Konstantin! Thanks for the ideas.
Below is my build information. I have already removed the .idea folder and reimported.
I'm not sure what else to try. Could there be a regression?
Jon
Can you share a sample project at YouTrack https://youtrack.jetbrains.com/newIssue?project=IDEA by creating new ticket?
Hi Konstantin,
Something very strange happened here. This bug seems to be intermittent! With no changes to that part of my core, it just went away a day later. I've actually seen this before and if it happens again, I will see if I can create a repro case.
Thanks,
Jon