2011-01-18 4 views
1

私は、出力された.warファイルにいくつかのプロパティファイルを移動できるようにmavenプロジェクトを持っていますので、Spring内のプロパティプレースホルダはプロパティファイルを利用できます。Maven WebResourcesはエラーをスローし続けます

現在のディレクトリ構造は次のとおりです。

|- src 
    |- main 
    |- properties 
     |- dev 
     |- int 
     |- live 
    |- test 
|- pom.xml 

私はSRC /プロパティ/ devのファイルを取得し、プレースホルダのためのwarファイルでそれらを置くことができるようにしたいです。しかし、私は現在、私のpomに以下の設定セクションがあります。

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-war-plugin</artifactId> 
    <version>2.0.2</version> 
    <configuration> 
     <webResources> 
      <resource> 
       <directory>src/properties/dev/</directory> 
      </resource> 
     </webResources> 
    </configuration> 
</plugin> 

それから私は、次のエラーを取得しておいてください。

[INFO] ------------------------------------------------------------------------ 
[ERROR] FATAL ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] basedir src\properties\dev does not exist 
[INFO] ------------------------------------------------------------------------ 
[INFO] Trace 
java.lang.IllegalStateException: basedir src\properties\dev does not exist 
    at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:542) 
    at org.apache.maven.plugin.war.AbstractWarMojo.getWarFiles(AbstractWarMojo.java:824) 
    at org.apache.maven.plugin.war.AbstractWarMojo.copyResources(AbstractWarMojo.java:408) 
    at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:518) 
    at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:347) 
    at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:164) 
    at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130) 
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) 
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) 
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) 
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 7 seconds 
[INFO] Finished at: Tue Jan 18 10:02:17 GMT 2011 
[INFO] Final Memory: 25M/62M 
[INFO] ------------------------------------------------------------------------ 

私は、それが存在することがわかっているが、私はこのエラーを取得されるだろう理由には何の情報もないように思わ、私は友人から助言されましたそれはかもしれないは、ソースコードフォルダではないプロパティに関連しているが、私は新しいソースフォルダを追加することができ、それは役に立たなかったようにcodehausプラグインを追加しようとしました。

答えて

2

私はあなたがマルチプロジェクトビルドを持っていると思います。 Hereがこれに関連する問題であり、2.1-Alphaに修正されています。

2.0.2

の代わりに <version>2.1.1<version>を使用してください。
関連する問題