7
Spring 3.1.1.RELEASE與Apache Maven 3.0.3和Maven Shade插件1.6。Spring 3 NamespaceHandler問題與Maven Shade插件
使用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"
如果我重寫屬性或列表(util),則問題消失。
太棒了,謝謝,這就是解決方案! –