2012-05-14 14 views
7

Spring 3.1.1.RELEASE with Apache Maven 3.0.3とMaven Shade Plugin 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とp-namespaceの両方に適用されますが、これに限定されないことを期待してください:

xmlns:util="http://www.springframework.org/schema/util" 
xmlns:p="http://www.springframework.org/schema/p" 

プロパティまたはリスト(util)の長さを書き直すと、問題は消えます。

答えて

17

設定にAppendingTransformerを追加してみてください。この例では、これはSpringハンドラにとって有用であると具体的に言及しています。

+0

恐ろしい、ありがとう、それは解決策です! –

関連する問題