0

要件は、maven プラグインを使用して Tomcat ルートにアプリケーションをデプロイすることです。

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
    <url>http://www.myhost.com:8080/manager</url>
    <server>tomcat6</server>
    <path>/</path>
    <contextFile>src/main/tomcatconf/context.xml</contextFile>
    <mode>context</mode>        
</configuration>

上記はアプリケーションをルートにデプロイしていますが、問題は、アプリケーションの外部に保存されている「静的」フォルダーからの画像、javascript、およびその他の pdf ファイル (サイズの大きい) を使用するアプリケーションです。 c:\static\

以下のような画像にアクセスするために pom.xml で必要な設定を提案してください。 http://www.myhost.com:8080/static/image.js http://www.myhost.com:8080/static/about.pdf

4

1 に答える 1

1

次のように組み込みの tomcat7 プラグインを取得できます。

  <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.0</version>
  </plugin> 
于 2013-06-21T11:22:38.743 に答える