私はgradleを使用してマルチプロジェクトJ2EEビルドを管理しています-最終目標は、ターゲットサーバーにデプロイし、解凍して実行できる一連のサーバーパッケージ/アーティファクトを生成することです。
つまり、各アーティファクトには、実行に必要なすべてのものが含まれています(JDKを除く)。
プロジェクトの構造は次のようになります。
Root project 'proto' - This is the master-build project
+--- Project ':applications' - Default build settings for applications
| +--- Project ':applications:foo' - Foo API
| +--- Project ':applications:bar' - Bar API
| \--- Project ':applications:baz' - Baz API
+--- Project ':common' - Common code shared by multiple projects
| \--- Project ':common:subcomponents' - Settings shared by subcomponents
| +--- Project ':common:subcomponents:configuration' - Configuration
| \--- Project ':common:subcomponents:initializer' - Initializers
+--- Project ':servers' - Default tasks for building server artifacts
| +--- Project ':servers:foobar' - Assembles and runs the foobar server
| +--- Project ':servers:foobaz' - Assembles and runs the foobaz server
| \--- Project ':servers:barbaz' - Assembles and runs the barbaz server
\--- Project ':webapps' - These are the defaults for webapps
+--- Project ':webapps:foo' - The webapp for foo
+--- Project ':webapps:bar' - The webapp for bar
\--- Project ':webapps:baz' - The webapp for baz
共通のアプリとWebアプリを相互に依存関係として構築することは非常に簡単ですが、サーバープロジェクトを構築することはやや困難であることが証明されています。
私の現在のアプローチは、「servers」フォルダー内の最低限のサーバーを使用し、その内容をビルド中のタゲットサーバーにコピーしてから、warファイルをコピーしてすべてを圧縮することです...しかし、私のルート/サーバー/ビルド.gradleは混乱し始めています。
したがって、問題は、「耳」スタイルのプラグインを作成することで、サーバーの構築を簡素化できるでしょうか。
また、私は現在resin-pro-3.0.25を使用していますが、すぐに(次の数か月)別のサーバーコンテナに切り替えることを計画しているため、正直な質問になります-サーバーアーティファクトを構築するときに同様のアプローチを使用している他の人々ですTomcat /桟橋用?
あなたの考えは大歓迎です!