maven-shade-plugin

今日咱们开发遇到spring的xsd文件打包的时候,丢失了,致使没法启动, spring

rg.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 33; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-3.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. apache

最后的解决方案是废弃assembly打包插件,使用shade。 maven

缘由见 http://blog.csdn.net/leonzhouwei/article/details/9978771 spa

插件代码以下: .net

<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-shade-plugin</artifactId> 
<version>1.4</version> 
<executions> 
<execution> 
<phase>package</phase> 
<goals> 
<goal>shade</goal> 
</goals> 
<configuration> 

<filters> 
<filter> 
<artifact>*:*</artifact> 
<excludes> 
<exclude>META-INF/*.SF</exclude> 
<exclude>META-INF/*.DSA</exclude> 
<exclude>META-INF/*.RSA</exclude> 
</excludes> 
</filter> 
</filters> 

<transformers> 
<transformer 
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> 
<resource>META-INF/spring.handlers</resource> 
</transformer> 
<transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
<mainClass>com.jd.payment.risk.benz.qpay.daylimt.DaylimitAmountTopology</mainClass> 
</transformer> 
<transformer 
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> 
<resource>META-INF/spring.schemas</resource> 
</transformer> 
</transformers> 
</configuration> 
</execution> 
</executions> 
</plugin>
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息