Failed to Resolve Artifact - Missing javax.mail When Building the Distribution Source Code

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

The mail artifact was installed successfully in the local repository, however building the Confluence source code failed.

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact. Missing: javax.mail:mail:jar:1.3.3

原因

While running the command with -Dpackaging=jar -Dfile=javamail-1_3_3_01.zip will execute. Maven would happily install (ie. copy across and rename) the file into your local repository and show a BUILD SUCCESSFUL message.

However, running the build script will give a Build Error.  This is because Java dependencies are jars and the same goes with maven. There is no way for Java or maven to know what to look for in the zip file.

(info) changing to -Dpackaging=zip will not work either.

When you try to run the build script - maven will be looking for a jar file, while the mail-1.3.3.jar (or whatever version) in your local repository actually contains more than just a jar file's content (they are actually the original zip files that are renamed, hence contain other files that come together with the zip files which cannot be understood by Maven and JVM).

ソリューション

Unzip javamail-1_3_3_01.zip and use the extracted jar file for your local repository installation.

mvn install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.3 -Dpackaging=jar -Dfile=mail.jar 

最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.