我正在创建一个OSGi包,它由以下依赖项组成
<artifactId>tomcat-dbcp</artifactId>
<artifactId>tomcat-embed-core</artifactId>
<artifactId>tomcat-embed-jasper</artifactId>
<artifactId>tomcat-embed-websocket</artifactId>
<artifactId>tomcat-jasper</artifactId>
<artifactId>ecj</artifactId>我想把SCI打包到websocket和jasper中。
我的IncludeResource部分如下
<Include-Resource>
{maven-resources},
@tomcat-jasper-${version.tomcat}.jar!/META-INF/*,
@tomcat-embed-websocket-${version.tomcat}.jar!/META-INF/*,
src/main/resources
</Include-Resource>这里的问题是,我只得到websocket SCi。我认为jasper资源被websocket资源覆盖。取决于我指定的顺序。
如何将两个资源放在同一个包中?
发布于 2015-04-27 09:09:33
我找到了答案。您可以使用maven-阴影插件来实现这个功能。
在我的场景中,我可以按以下方式打包两个SCI
<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>https://stackoverflow.com/questions/29889047
复制相似问题