2011-12-05 16 views
1

mvnのインストール後にweblogic.xmlをWEB-INFフォルダに配置する際に問題があります。私のweblogic.xmlファイルは、SRC /メイン/リソース/ weblogic.xmlの下にあり、私はインストール後にWEB-INFの下に置くことにしたい(包装方法によって「戦争」である)Maven 2 Weblogic.xmlの置き換え

私はこの試みた:。

<resources> 
      <resource> 
       <directory>src/main/resources</directory> 
       <targetPath>../resources</targetPath> 
       <excludes><exclude>web.xml</exclude><exclude>weblogic.xml</exclude></excludes> 
      </resource> 
      <resource> 
       <directory>src/main/resources/config</directory> 
       <targetPath>..</targetPath> 
       <includes><include>weblogic.xml</include></includes> 
      </resource> 
     </resources> 
は それは私が日食使用してクラスパスをしたい時にインストールしますがと協力して

:リソースパスの場所の種類をネストできません出力フォルダ「ResponseManager /ターゲット/ WEB-INF

説明:日食は、それはエラーになります/ resources '出力フォルダ内 ' ResponseManager/target/WEB-INF '任意のアイデア

<classpathentry kind="src" path="src/main/resources" output="target/WEB-INF/resources" excluding="web.xml|weblogic.xml|**/*.java"/> 
    <classpathentry kind="src" path="src/main/resources/config" output="target/WEB-INF" including="weblogic.xml" excluding="**/*.java"/> 

:ResponseManagerがあるため、クラスパスにこのconfので 経路問題

を構築し、パスを構築しますか?

答えて

6

通常、src/main/resourcesのファイルは、コンパイルされたクラスファイルにパッケージ化されており、WebアプリケーションではWEB-INF/classesに配置されます。これらを標準経路の下に置くことができない理由はありますかsrc/main/webapp

あなたはこのような戦争のプラグインでこれらのリソースを設定する方が良いだろうsrc/main/webappフォルダにない追加ファイルをパッケージ化する必要がある場合:targetPathとして指定する

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-war-plugin</artifactId> 
    <version>2.1</version> 
    <configuration> 
     <webResources> 
      <resource> 
       <directory>src/main/config</directory> 
       <targetPath>WEB-INF</targetPath> 
       <includes> 
        <include>weblogic.xml</include> 
       </includes> 
      </resource> 
     </webResources>      
    </configuration> 
</plugin> 

それは可能なはず元のフォルダの中に目的のディレクトリ構造を再現するのがよりクリーンであると思います。

+0

私はそれらがクラスではなくリソースであるため、クラスフォルダの下に置かないようにしています。これは私がMavenに同意しない1つのことです:フォルダ構造。ありがとう、それは働いた – Neron

関連する問題