問題タブ [maven-tomcat-plugin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
tomcat7 - Tomcat 7 Maven Plugin multiple context
In my current state of the pom.xml i have
this is working fine. I now am trying to add an extra context for the images on the server,
so that the "old" context /myPath
is directing to the webapp and /images
can be used to address images.
I have tried to add a context file, but when I do this only my /images
context is loaded.
Also, I don't want to build the WAR each time (this would be the case if I used two context.xml files for the two contexts)
Is it possible to add a) the context as it is (the current state of development using tomcat7:run AND b) the second context /images that only points to a local folder? And how?
java - tomcat:run の JSP から生成されたサーブレットはどこにありますか?
以前は、Eclipse でサーバーを使用して webapp をデプロイ/実行していましたが、生成されたサーブレットを で簡単に見つけることができました...metadata/.plugins/org.eclipse.wst.server.core/...
。m2e に移行し、tomcat:run を使用して webapp をデプロイおよび実行しましたが、生成されたサーブレットをどこで見つけることができるのでしょうか?
maven - tomcat7-maven-plugin:run で異なる web.xml 記述子を使用するには?
web.xml
Maven プロジェクトに2 つの異なる記述子ファイルが必要です。1 つ目 (デフォルト) は、アプリケーション サーバーへの展開用に war ファイルに含める必要があり、2 つ目は を使用した開発に使用する必要がありますtomcat7-maven-plugin:run
。<tomcatWebXml>
パラメータがあることは知っていますがweb.xml
、変更したくないTomcatグローバルを指定しています。
のjetty-maven-plugin:run
いずれかを指定でき<webApp>/<descriptor>
ます<webApp>/<overrideDescriptor>
。1 つ目は default を指定されたファイルに置き換えweb.xml
、2 つ目は default に加えて指定されたファイルの内容を適用しますweb.xml
。
で同じ機能を実現する方法はありtomcat7-maven-plugin
ますか?
java - tomcat7 maven プラグインの 'run' ゴールを使用した Eclipse maven 実行構成がデフォルトのコンテキスト パスを尊重しない
私はローカルで Web サービスに取り組んでおり、maven を使用してビルドし、tomcat にデプロイしています。実行構成として使用して、maven プラグインを使用してローカルでmvn tomcat:run
実行しています。
現在、私のサービスは、デフォルトのプロジェクト名をコンテキスト パスとして使用してデプロイされています。
http://localhost:8080/myArtifactId/servletPath
代わりに、コンテキスト パスを削除するためにデプロイし、Tomcat Maven プラグインを構成してこの URL にデプロイしたいと思います。
http://localhost:8080/servletPath
このドキュメントごと: http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/usage.html
私はこれを試しています:
私がしようとしていることがうまくいかない理由、またはこれについて別の方法で何か考えはありますか? 私が述べたように、私はmavenプラグインを介してこれをやろうとしています。
または、これを引数として実行構成に渡す方法を知っている人はいますか? コマンドラインで明示的に渡すと、デフォルトが上書きされる可能性があります。
更新:mvn tomcat7:run
またはコマンドラインから実行mvn clean tomcat7:run
すると、これが意図したとおりに機能するようです。しかしMaven Build
、Eclipse で実行構成を使用して実行すると、パス変数に入力した内容に関係なく、サービスはデフォルトのアーティファクト ID を使用して開始されますpom.xml
。
更新:これは、Eclipse Maven プラグインに問題があるようです。コマンドラインからコマンドを実行すると、すべてが期待どおりに機能しますが、Tomcat7:run ゴールで Eclipse/Maven 実行構成を追加しようとすると、プロジェクトはデフォルトのアーティファクト ID コンテキスト パスを使用して実行され続けます。
maven - Tomcat 7 Maven プラグインの完全な構成リファレンス
tomcat 7 maven プラグイン構成に関するオンライン リファレンスが見つからないようです。例 :
これまでに得たいくつかの例は、より多くの構成オプションを示しています。
- http://mojohaus.org/tomcat-maven-plugin/usage.html
- Maven-Tomcat プラグインの追加のコンテキスト パスを設定するにはどうすればよいですか?
ただし、これらは完全な構成リファレンスではありません。構成参照はどこにあるのだろうか?