Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jsr305 dependency #2782

Closed
orionll opened this issue Apr 11, 2017 · 4 comments
Closed

Remove jsr305 dependency #2782

orionll opened this issue Apr 11, 2017 · 4 comments

Comments

@orionll
Copy link

orionll commented Apr 11, 2017

I tried to compile guava with Java 9 and failed. The problem is the jsr305 dependency. It contains a package javax.annotation which conflicts with the same package in the java.base module (javax.annotation.PostConstruct annotation and others). Java 9 forbids split packages.

Java 9 is not released yet, but we can already start thinking what to do. Is it possible to replace jsr305 annotations with similar annotations?

@jbduncan
Copy link
Contributor

Related issue: #2571

@ben-manes
Copy link
Contributor

I thought this was resolved as part of JEP 261

@orionll
Copy link
Author

orionll commented Apr 12, 2017

@ben-manes is right. The problem has nothing to do with split packages because java.se does not include the javax.xml.ws.annotation module and there is no conflict during compilation. However, there is still an issue with the jsr305 module name. This is an automatic module (since it does not have module-info.java) and I don't know what to write in module-info.java. This does not work:

module guava {
    requires jsr305; // javac fails: module not found: jsr305
    ...
}

I think the problem is the Java 9 module naming rules. It discourages modules with terminal digits. And if I change the jar name to jsr.jar, everything gets fine:

module guava {
    requires jsr; // OK
    ...
}

So, renaming jsr305.jar to jsr.jar can be a workaround.

@orionll
Copy link
Author

orionll commented Jul 24, 2017

I think this can be closed since Java 9 now allows digits at the end of module names: http://openjdk.java.net/projects/jigsaw/spec/issues/#VersionsInModuleNames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants