<artifactId>tomcat-dbcp</artifactId>
<artifactId>tomcat-embed-core</artifactId>
<artifactId>tomcat-embed-jasper</artifactId>
<artifactId>tomcat-embed-websocket</artifactId>
Both tomcat-embed-jasper and tomcat-embed-websocket contains SCIs. I wanted to bundle these dependencies to a single OSGi bundle with all their SCIs. If we use maven-bundle plugin as follows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Include-Resource> | |
{maven-resources}, | |
@tomcat-embed-websocket-${version.tomcat}.jar!/META-INF/*, | |
@tomcat-embed-jasper-${version.tomcat}.jar!/META-INF/*, | |
src/main/resources | |
</Include-Resource> |
We can use maven-shade-plugin to overcome the issue. It has lot of other features as well. You can refer to the official documentation page for more details about shade-plugin
Maven-shade-plugin
If you wanna combine all the META-INF/services (like what I wanted to do) you can use following configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> | |
<version>2.3</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>shade</goal> | |
</goals> | |
<configuration> | |
<transformers> | |
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | |
</transformers> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> |