You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gainty <mg...@hotmail.com> on 2016/05/30 20:40:32 UTC

maven-surefire and static-swamp

I was convinced maven-surefire-plugin classloader was mucked producing NoClassDefFoundError  configed maven-surefire-plugin

useSystemClassLoader=true and useManifestOnlyJar=false.NoClassDefFoundError displayed..no joy
<useSystemClassLoader>false</useSystemClassLoader>NoClassDefFoundError displayed..still no joy

then i read this blog:http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html
VM not initializing statics causes NCDFE ???

the original coder was obsessed with static singleton model
I ripped out all the statics and went with ctor and voila NoClassDefFoundError disappeared

environment:
Apache Maven 3.2.5
Java version: 1.8.0_40, vendor: Oracle CorporationJava home: /jdk1.8/jreDefault locale: en_US, platform encoding: Cp1252
why adding static methods or static variables to a class called from maven-surefire-plugin cause NoClassDefFoundError
?
Martin