Maven shade + resteasy You can find the author for the content type

I have a project that works great with maven managed dependencies. But I have a requirement to provide my jar files as one.

For this, I use the maven-shade plugin ( http://maven.apache.org/plugins/maven-shade-plugin/ ). All class files are exported correctly, but when I try to start the application, I get an error message:

Can find the author for the multipart / form-data type of the content type: org.jboss.reasteasy.plugins.provider.multipart.MultipartFormDataOutput

Any help would be great, thanks.

Note. I had a similar problem with spring, the main reason for which is the configuration files. Many jar files contain a configuraiton file of the same name. All configuration files try to override the rest. After merging this file with the configuration problem, maven-shade was resolved.

+1
java maven jax-rs maven-shade-plugin resteasy
source share
1 answer

You may be missing one of the Shade transformers listed below. I saw the same error as yours when running "java -jar" in my jade file created by Shade. Make sure you have an org.apache.maven.plugins.shade.resource.ServicesResourceTransformer entry. JAR files that provide the implementation of some interfaces are often supplied with the META-INF / services / directory, which maps the interfaces to their implementation classes for a service locator to search. To combine multiple implementations of the same interface into a single service record, you can use ServiceResourceTransformer. I believe this was the case when RestEasy runs under Shade.

<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>path.to.your.App</mainClass> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> 
+1
source share

All Articles