有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java maven在JFrog artifactory(snapshotrepo)中找不到具有第三方libs的jar文件

我的团队正在使用JFrog artifactory,它部署了一个第三方库

我的设置。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,我自己的项目依赖于它(导入pom的BOM样式以构建我自己的本地项目)。看起来maven成功地下载了所有内容,直到它到达一个特定的jar:

Could not resolve dependencies for project xxx:1.1.0: The following artifacts could not be resolved: com.japisoft:xmlpad-res:jar:3.7

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

为什么maven找不到该文件,我能做些什么


共 (1) 个答案

  1. # 1 楼答案

    我在错误地删除/修改maven时遇到了同样的问题。设置文件

    要解决此问题,请尝试以下步骤:

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