maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé BOUTEMY <herve.bout...@free.fr>
Subject Re: maven and java11
Date Wed, 14 Nov 2018 22:12:56 GMT
oh, subtle issue

can you provide a unit test, please?

regards,

Hervé

Le mercredi 14 novembre 2018, 16:34:30 CET Romain Manni-Bucau a écrit :
> assume i have a standard package-info.json with @XmlSchema, nothing crazy
> in jaxb land.
> 
> jaxb will do a loadClass(module, "com.foo.mypackage.package-info"), this
> will call findClass(String /*module.getName()*/, String) which will call
> findClass(String) (default impl in ClassLoader parent class of any
> classloader impl).
> 
> ClassRealm will expect findClass(String) to be loaded from
> loadClass(String[,boolean]) so always throws ClassNotFoundException since
> it is not expected to be used (instead the lookup strategy - API -  is
> used).
> 
> So in the previous cases of jaxb the loadClass will throw a ClassNotFound
> which makes the metadata just wrong.
> 
> This is a vicious bug which means not a single mojo can use the java 11
> classloader API. By itself it sounds ok but since a lot of libs are
> starting to use it, it means mojo are not working under java 11 until the
> mojo creates another classloader which is not the case for standard simple
> tasks mojos.
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> 
> 
> Le mer. 14 nov. 2018 à 10:00, Tibor Digana <tibordigana@apache.org> a
> 
> écrit :
> > Hi Romain,
> > 
> > Which class could not be loaded?
> > JAXB or CDI class?
> > Some class from Maven dist or another one?
> > 
> > BR,
> > Tibor
> > 
> > On Tue, Nov 13, 2018 at 5:35 PM Romain Manni-Bucau <rmannibucau@gmail.com>
> > 
> > wrote:
> > > Hi guys,
> > > 
> > > did you plan to fix and upgrade classworlds to support java11?
> > > 
> > > The trick is in
> > 
> > org.codehaus.plexus.classworlds.realm.ClassRealm#findClass.
> > 
> > > This method assumes it can't be called outside
> > 
> > loadClass(String[,boolean])
> > 
> > > but in j11 there is loadClass(String, String) defaulting to it as well
> > > so
> > > it just fails and breaks a lot of mojo. One lib using that feature is
> > 
> > jaxb
> > 
> > > >= 2.3.0 so any mojo relying on jaxb 2.3 is broken.
> > > 
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <
> > > https://github.com/rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <
> > 
> > https://www.packtpub.com/application-development/java-ee-8-high-performanc
> > e




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message