Maven を使用して依存関係を管理し、プロジェクトをビルドしています。プロジェクトをビルドしようとしたところ、Maven が Mulesoft Enterprise リポジトリで依存関係を見つけられないというエラーが表示されますが、これはカスタム依存関係であり、Mulesoft リポジトリには見つりません。エラーメッセージは次のようなものです。
[ERROR] Failed to execute goal on project PROJECT_NAME:Could not resolve dependencies for project com.mycompany:project_name:mule:1.0.0:Failed to collect dependencies at your.package:artifact:jar:1.0.0:Failed to read artifact descriptor for your.package:artifact:jar:1.0.0:Could not transfer artifact your.package:artifact:pom:1.0.0 from/to releases-ee (https://repository.mulesoft.org/nexus/content/repositories/releases-ee/):Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
Maven では不可解なエラーが生じることがあり、Maven が正しい場所を検索していないように見えて、実際は単にすべてのリポジトリの場所を定義しており、Maven は .m2 内の Maven ローカルリポジトリを含むすべてのリポジトリの場所を検索してそれらを見つけようとしています。
このエラーは、Maven が依存関係を見つけられないため、最終的に Mulesoft Enterprise Nexus リポジトリで検索しようとし、見つけられないために失敗するという事実によって引き起こされます。これは、実際には Mule リポジトリや Mule Maven プラグインとは関係ありません。
この問題のソリューションは、ローカルの Maven settings.xml 設定を再確認し、Maven がこの特定の依存関係を取得できる正しいリポジトリが構成されていることを確認することです。参照記事「settings.xml と pom.xml の例で Enterprise Maven Repository の認証情報を使用する方法」
それでもこの問題が解決しない場合は、Maven を使用して依存関係ツリーと有効な POM を取得し、どのコンポーネントがこの依存関係を要求しているかを調べます。コマンドラインは以下のようになります。
mvn clean package -X -e > mvninstall.txt mvn dependency:tree -Dverbose > mvnTree.txt mvn help:effective-pom -X > mvnpom.txt
必須ファイルがある場合は、アーティファクトをビルドサーバーの適切な .m2 フォルダーにコピーすることで問題を解決できます。
001118073

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.