How/Why is Maven Assembly Different the Shade Different from OneJar
I am working on a web service using Spring, Jax-Rs, and embedded Jetty. I
have a starter class that spins up the server, initializes the context,
all that. Thats all good.
However, the only way I have been able to compile it into a single,
executable jar is with the OnJar Maven plugin:
https://code.google.com/p/onejar-maven-plugin/
When I tried using the Maven Shade and Assembly plugins, both successfully
compiled, but then had major runtime errors, such as:
Nested exception is
org.apache.cxf.service.factory.ServiceConstructionException
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
Given that the OneJar plugin is not hosted on Maven Central, I need access
to the plugin repository for my job, but what if thats not possible? How
do I get the Maven Assembly plugin to work. Why is it failing? Is the
assembly plugin somehow flawed in how it compiles everything together?
No comments:
Post a Comment