mvn clean install fails for fresh plugin using java 7

205 views
Skip to first unread message

dodtsair

unread,
Oct 23, 2011, 11:51:38 PM10/23/11
to Jenkins Users
This is the failure during a java 7 run. Looks like it is using sun
specific classes?
Is this a known problem? I suppose the fix is to fall back to java
1.6 until java 7 is supported.
mvn -cpu hpi:create -DgroupId=org.sample -DartifactId=sample
cd sample/
mvn clean install
...
Oct 23, 2011 8:45:40 PM org.sonatype.guice.bean.reflect.NamedClass
WARNING: Error injecting:
org.jvnet.hudson.maven.plugins.hpi.AptCompiler
java.lang.NoClassDefFoundError: com/sun/mirror/apt/
AnnotationProcessorFactory
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getDeclaredConstructors(Class.java:1853)
...
sudo update-java-alternatives -s java-1.6.0-openjdk
mvn clean install
...
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 28.528s
[INFO] Finished at: Sun Oct 23 20:47:27 PDT 2011
[INFO] Final Memory: 32M/267M
[INFO]
------------------------------------------------------------------------

Jesse Farinacci

unread,
Oct 24, 2011, 8:50:05 AM10/24/11
to jenkins...@googlegroups.com
Greetings,

On Sun, Oct 23, 2011 at 11:51 PM, dodtsair <mpower...@dodtsair.com> wrote:
> This is the failure during a java 7 run.  Looks like it is using sun
> specific classes?

If it were actually Sun-specific classes, then why would OpenJDK work?

> Is this a known problem?  I suppose the fix is to fall back to java
> 1.6 until java 7 is supported.

I don't think many people are developing with Java 7 yet. Only
recently, Java 6 was made a requirement and that is evidenced with
m-hpi-p changes to rely on Java 6's APT instead of pre-Java 6 com.sun
compiler tricks.

> mvn -cpu hpi:create -DgroupId=org.sample -DartifactId=sample

> org.jvnet.hudson.maven.plugins.hpi.AptCompiler
> java.lang.NoClassDefFoundError: com/sun/mirror/apt/
> AnnotationProcessorFactory

So, check which version of m-hpi-p is being created with the
archetype, and ensure it is something like 1.22 or better.

-Jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

Reply all
Reply to author
Forward
0 new messages