maven 在具有第三方库的 JFrog 工件工厂(快照存储库)中找不到 jar 文件



我的团队正在使用JFrog artifactory,并且部署了第三方lib。

我的设置.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
    <profile>
        <id>dev</id>
        <properties>
            <artifactory.url>http://myartifactory.com</artifactory.url>
            <artifactory.username>blah</artifactory.username>
            <artifactory.passwd>blah</artifactory.passwd>
            <artifactory.maven.snapshot>maven-integration-local</artifactory.maven.snapshot>
            <artifactory.maven.thirdparty>maven-third-party-local</artifactory.maven.thirdparty>
            <artifactory.maven.rc>maven-release-candidate-local</artifactory.maven.rc>
            <artifactory.maven.release>maven-release-local</artifactory.maven.release>
            <artifactory.maven.all>maven-repo</artifactory.maven.all>
        </properties>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>snapshot-repo</id>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>interval:1</updatePolicy>
                </snapshots>
                <name>maven-integration-local</name>
                <url>http://myartifactory.com</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>jcenter</id>
                <url>http://jcenter.bintray.com</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
            <pluginRepository>
                <id>artifactory-plugin</id>
                <url>${artifactory.url}/${artifactory.maven.all}</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

artifactory包含一个pom,我自己的项目依赖于它(BOM风格的pom导入以构建我自己的本地项目)。看起来maven成功地下载了所有的FINE,直到它到达一个特定的罐子:

无法解析项目xxx:1.1.0:的依赖项工件无法解析:com.japisoft:xmlpad-res:jar:3.7

我检查了一下,这个jar确实存在于artifactory(xmlpad-res-3.7.jar)中,但maven声称它找不到它。我尝试下载这个jar并使用maven安装插件安装它,但这没有帮助。

为什么maven找不到文件,我该怎么办?

我在错误地删除/修改maven.settings文件时遇到了同样的问题;

要修复此问题,请尝试以下步骤:

  1. 首先更新.m2文件夹中的本地jar:右键单击project>Maven>更新项目(选中"force"复选框)
  2. 现在,通过浏览.m2文件夹来检查您的本地存储库;搜索对于丢失的jar(应该按照中的定义定位pom;即.m2/repository/path/to/your/jar
  3. 检查.settings.xml文件中的maven设置(通常在.m2文件夹中);直接浏览到文件或pom中指定的路径以验证连接
  4. 检查您的jfrog存储库是否正在运行;尝试重新启动服务器并再次更新您的项目;再次检查.m2文件夹(在我的情况下,我有xxx.lastupdate文件,但没有jar)
  5. 查看jfrog日志了解有关该问题的更多详细信息;有关如何查找日志的更多详细信息,请选中此项:https://www.jfrog.com/confluence/display/RTF/Artifactory+日志+文件

最新更新