I am trying to package Grizzly with Jersey as a single jar using Maven shade plugin. But I always get the message No container provider supports the type class org.gla
The following links helped me figuring out the solution below:
especially the answer
Instead of using the jar-with-dependencies as the descriptorRef of your assembly-plugin configuration you create our own e.g. in src/assembly/depmerge.xml (see below). This assembly configuration will add a containerDescriptorHandler that cares for the META-INF/services.
run
mvn clean compile assembly:single
to get a jar file in target which you can call with
java -jar target/x.y.-version-jar-with-dependencies.jar
pom.xml:
maven-assembly-plugin
2.5.3
${mainClass}
src/assembly/depmerge.xml
src/assembly/depmerge.xml:
jar-with-dependencies-and-services
jar
false
/
true
true
runtime
metaInf-services