春天3.1.1.RELEASE与Apache Maven的3.0.3和Maven插件阴影1.6。
使用MVN遮阳插件打包在尤伯杯罐,包括它的依赖该工件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.MyApplication</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
似乎包装得很好,但在执行抱怨的春天NamespaceHandler问题:
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/util]
Offending resource: class path resource [spring/test-context.xml]
这适用于UTIL和对命名空间两者,但预计它不局限于这些:
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
如果我重写属性或列表(使用率)手写的问题就消失了。