我々のUIプロジェクトには、EJBクライアントの依存関係を使用して、かなりの数のビジネスサービスを含むソリューションがあります。 Mavenのこの問題は、クライアント.jarには通常約1-2のクラスが含まれていても、サービスアプリケーション全体の完全な依存関係スタックを持っていることになります。これは、.earファイルが50-100Mbまで成長し始めると少し醜いものになるかもしれません。と UIアプリケーションに侵入する無関係の依存関係のために時々厄介なエラーがあります。Maven ejb-clientジェネリック依存関係の除外
もちろん、クライアント側の依存関係を常に除外することはできますが、それらのサービスを使用して各クライアントプロジェクトに同じ束の行を書き込む必要があり、それは不必要な繰り返しです。さらに、人々は奇妙なエラーメッセージを思いつき、それらを追跡するために多くの時間を費やしてから、いくつかのクライアントのjarファイルが含まれていることを覚えておいて、それがどのような依存関係になっているかを確認しませんでした。
例:
ただ一つのサービスのクライアントが含まれている <dependency>
<groupId>fi.path.to.service</groupId>
<artifactId>customermanagement-common</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>fi.path.to.service</groupId>
<artifactId>customermanagement-service</artifactId>
<classifier>client</classifier>
<exclusions>
<exclusion>
<groupId>fi.path.to.dependency</groupId>
<artifactId>internal-dependency-#1</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
</exclusion>
<exclusion>
<groupId>fi.path.to.dependency</groupId>
<artifactId>internal-dependency-#2</artifactId>
</exclusion>
<exclusion>
<artifactId>internal-dependency-#3</artifactId>
<groupId>fi.path.to.dependency</groupId>
</exclusion>
<exclusion>
<artifactId>internal-dependency-#4</artifactId>
<groupId>fi.path.to.dependency</groupId>
</exclusion>
<exclusion>
<artifactId>internal-dependency-#5</artifactId>
<groupId>fi.path.to.dependency</groupId>
</exclusion>
<exclusion>
<artifactId>castor-xml</artifactId>
<groupId>org.codehaus.castor</groupId>
</exclusion>
<exclusion>
<artifactId>castor-codegen</artifactId>
<groupId>org.codehaus.castor</groupId>
</exclusion>
<exclusion>
<artifactId>castor-xml-schema</artifactId>
<groupId>org.codehaus.castor</groupId>
</exclusion>
<exclusion>
<artifactId>internal-dependency-#6</artifactId>
<groupId>fi.path.to.dependency</groupId>
</exclusion>
</exclusions>
<version>2.6</version>
</dependency>
、複数の異なるアプリケーションでこれらのいくつかを想像し、あなたが画像を取得し、それぞれの時間をすべて除外を書くことは非常に迷惑ですし、プロジェクトPOMはかなり長引くようになる。
私は提供された依存関係をマークしますが、存在しない場合は実行時にクラッシュするいくつかの依存関係があります。外部Exceptionクラスを持つ別のアプリケーションへの別のサービスコールを含むサービスを呼び出すと、サービスプロジェクト内にラップされていない理由があります。存在しない場合は実行時にClassNotFoundExceptionが発生します。
したがって、maven-ejb-pluginでpom.xmlを使用してクラスをejbクライアントから除外/インクルードすることは可能ですが、依存関係も除外する方法はありますか?
同様の問題に直面して、CIソリューションを使用してプロジェクトを構築する方法を変更することは、企業内の他のすべてのアプリケーションとは機能が異なる場合、大きな混乱となり、メンテナンスの問題となります。 – t0mppa