Maven构建错误:无法找到资源' javax.mail:mail:jar:1.3.3'在存储库atlassian-contrib中

时间:2015-08-07 09:00:41

标签: java maven javamail

我是从 Confluence 来源(由客户提供)构建项目但是出现以下错误。

[INFO] Using default encoding to copy filtered resources.
Downloading: https://m2proxy.atlassian.com/repository/public/javax/mail/mail/1.3.3/mail-1.3.3.jar
[INFO] Unable to find resource 'javax.mail:mail:jar:1.3.3' in repository atlassian-proxy (https://m2proxy.atlassian.com/repository/public)
Downloading: https://m2proxy.atlassian.com/contrib/javax/mail/mail/1.3.3/mail-1.3.3.jar
[INFO] Unable to find resource 'javax.mail:mail:jar:1.3.3' in repository atlassian-contrib (https://m2proxy.atlassian.com/contrib)
Downloading: http://repo1.maven.org/maven2/javax/mail/mail/1.3.3/mail-1.3.3.jar
[INFO] Unable to find resource 'javax.mail:mail:jar:1.3.3' in repository central (http://repo1.maven.org/maven2)
[INFO]    ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]    ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) javax.mail:mail:jar:1.3.3

  Try downloading the file manually from:
  http://java.sun.com/products/javamail/downloads/index.html

  Then, install it using the command:
  mvn install:install-file -DgroupId=javax.mail -DartifactId=mail    -Dversion=1.3.3 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
  mvn deploy:deploy-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
    1) com.atlassian.xwork:atlassian-xwork-core:jar:1.13
    2) opensymphony:webwork:jar:2.1.5
    3) javax.mail:mail:jar:1.3.3

----------
1 required artifact is missing.

for artifact:
  com.atlassian.xwork:atlassian-xwork-core:jar:1.13

from the specified remote repositories:
  atlassian-proxy (https://m2proxy.atlassian.com/repository/public),
  central (http://repo1.maven.org/maven2),
  atlassian-contrib (https://m2proxy.atlassian.com/contrib)

但在此之前,我运行以下 maven 脚本在maven 存储库中创建必要的子文件夹。

F:\Java\java-dev\Confluence\confluence-5.3.4-source>mvn3 install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.3 -Dpackaging=jar -Dfile=mail-1.3.3.jar -s "settings.xml" -Dmaven.repo.local=C:/Users/PC/.m2/repository

之后创建了以下文件夹和子文件夹,如下所示。 enter image description here

最后, settings.xml 文件作为参数提供,如下所示

<settings>
<localRepository></localRepository>
<profiles>
    <profile>
        <id>atlassian-repositories</id>
        <repositories>
            <repository>
                <id>atlassian-proxy</id>
                <name>Atlassian Maven 2 Proxy</name>
                <url>https://m2proxy.atlassian.com/repository/public</url>
            </repository>
            <repository>
                <id>atlassian-contrib</id>
                <name>Atlassian Contrib Repository</name>
                <url>https://m2proxy.atlassian.com/contrib</url>
            </repository>
        </repositories>
    <pluginRepositories>
    <pluginRepository>
                <id>atlassian-proxy</id>
                <name>Atlassian Maven 2 Proxy</name>
                <url>https://m2proxy.atlassian.com/repository/public</url>
            </pluginRepository>
    </pluginRepositories>
    </profile>
</profiles>
<activeProfiles>
    <activeProfile>atlassian-repositories</activeProfile>
</activeProfiles>

<mirrors>
    <mirror>
        <id>glassfish-mirror</id>
        <name>Mirror for glassfish</name>
        <url>https://maven.atlassian.com/content/repositories/atlassian-3rdparty/</url>
        <mirrorOf>glassfish-repository</mirrorOf>
    </mirror>
    <mirror>
        <id>laughing-panda-mirror</id>
        <name>Mirror for laughing panda</name>
        <url>https://m2proxy.atlassian.com/repository/public</url>
        <mirrorOf>laughing panda</mirrorOf>
    </mirror>
</mirrors>

所以,我猜这个问题很愚蠢(我不是专家),专家提供的帮助可以解决这个问题。谢谢。

2 个答案:

答案 0 :(得分:0)

<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.5.0-b01</version>
</dependency>
  

现在这个工件有新版本 javax.mail:mail:jar:1.3.3

     

新版本是   新版 1.5.0-b01

您可以在此处下载mvn repo link

如果您在下载依赖性方面遇到问题,可以按照answer

进行操作

此链接可以帮助您installing maven plugin

  

解决方案2:   解压缩javamail-1_3_3_01.zip并使用解压缩的jar文件进行本地存储库安装。

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

来源Confluence

答案 1 :(得分:0)

我修复了将此附加存储库添加到 settings.xml 设置文件中的问题。感谢大家的帮助。

<repository>
    <id>localrepo</id>
    <url>file://F:/Java/java-dev/Confluence/confluence-5.3.4-source/`pwd`/localrepo</url>
</repository>