[cdi-dev] Duplicate javax.annotation packages and Java 9

Matej Novotny manovotn at redhat.com
Mon Oct 23 02:54:45 EDT 2017


Hi

Haven't come across that one yet, but what Romain says is right.
You cannot have the same package coming from multiple modules.
So the only way is to make sure they come from one module - so either unnamed module, 
or not using their internal module (which I am not sure is possible here).

I don't really know how they imagine people will deal with this...
Every other project out there will have similar problems.

Matej

----- Original Message -----
> From: "Romain Manni-Bucau" <rmannibucau at gmail.com>
> To: "John Ament" <john.ament at spartasystems.com>
> Cc: "cdi-dev" <cdi-dev at lists.jboss.org>
> Sent: Saturday, October 21, 2017 6:17:52 PM
> Subject: Re: [cdi-dev] Duplicate javax.annotation packages and Java 9
> 
> Hi John,
> 
> the exact same issue happens with @Nullable which is used by a bunch of
> libraries (static code analyzis, @AutoValue of guava etc...)
> 
> Best i was able to do was to force all these javax annotation to be load in a
> classloader which is not the root JVM one but this is a huge regression of
> java 9 which has no solution and oracle claims it is intended since it is a
> bad practise to have packages over jars (even if jars are abstracted into a
> classloader so this is not something which means anything) :(.
> 
> A workaround is to not activate the JVM javax.annotation package and provide
> all javax.* in the unamed module but this will not last very long since all
> modules will slowly be named with time.
> 
> Hope it helps a bit even if it doesn't solve anything.
> 
> 
> 
> Romain Manni-Bucau
> @rmannibucau | Blog | Old Blog | Github | LinkedIn
> 
> 2017-10-21 16:22 GMT+02:00 John Ament < john.ament at spartasystems.com > :
> 
> 
> 
> 
> 
> Hey all
> 
> 
> 
> 
> Not sure where else to turn 😊
> 
> 
> 
> 
> I'm trying to start testing my apps on Java 9, I believe Java 9 kicks back
> the javax.annotation dependency that CDI declares due to a package collision
> with the built in JDK's javax.annotation package . The errors I get are due
> to missing javax/annotation/Priority. I'm wondering if anyone else has tried
> this, and if there's a clean work around?
> 
> 
> 
> 
> John
> 
> 
> 
> 
> NOTICE: This e-mail message and any attachments may contain confidential,
> proprietary, and/or privileged information which should be treated
> accordingly. If you are not the intended recipient, please notify the sender
> immediately by return e-mail, delete this message, and destroy all physical
> and electronic copies. Thank you.
> 
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> Note that for all code provided on this list, the provider licenses the code
> under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas
> provided on this list, the provider waives all patent and other intellectual
> property rights inherent in such information.
> 
> 
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> Note that for all code provided on this list, the provider licenses the code
> under the Apache License, Version 2
> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other intellectual
> property rights inherent in such information.



More information about the cdi-dev mailing list