简体   繁体   English

Maven在带有第三方库的JFrog工件(snapshot-repo)中找不到jar文件

[英]maven can't find jar file in JFrog artifactory (snapshot-repo) with third-party libs

My team is using JFrog artifactory and it has a 3rd-party lib deployed to it. 我的团队正在使用JFrog工件,并且已向其部署了3rd-party库。

My settings.xml: 我的settings.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>

The artifactory contains a pom, which my own project is dependent on (BOM style import of pom to build my own local project). 工件包含一个pom,这是我自己的项目所依赖的(导入pom的BOM样式以构建我自己的本地项目)。 And it looks like maven is successfully downloading everything FINE until it gets to a specific jar: 看起来maven成功下载了FINE的所有内容,直到到达特定的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 无法解析项目xxx:1.1.0的依赖项:无法解析以下工件:com.japisoft:xmlpad-res:jar:3.7

I checked and the jar does indeed exist in the artifactory (xmlpad-res-3.7.jar), but maven claims that it can't find it. 我检查了一下,jar确实存在于工件(xmlpad-res-3.7.jar)中,但是maven声称找不到它。 I tried downloading the jar and installing it using maven install plugin, but this did not help. 我尝试下载jar并使用maven install plugin安装它,但这没有帮助。

Why can't maven find the file and what can I do about it? 为什么Maven找不到文件,我该怎么办?

I encountered the same problem when mistakenly removed/modified the maven .settings file; 错误地删除/修改了maven .settings文件时,我遇到了同样的问题。

To fix that try the following steps: 要解决此问题,请尝试以下步骤:

  1. Start by updating your local jars in .m2 folder: Right click on your project > Maven > Update Project (check the ' force ' check box) 首先更新.m2文件夹中的本地jar:右键单击您的项目> Maven>更新项目 (选中“ 强制 ”复选框)
  2. Now check your local repository by browsing to your .m2 folder; 现在,通过浏览到.m2文件夹来检查本地存储库; search for the missing jar (should be located exactly as it's defined in the pom; ie .m2/repository/path/to/your/jar ) 搜索丢失的jar(应完全按照pom中定义的位置放置;即.m2 / repository / path / to / your / jar
  3. Check your maven settings in .settings.xml file (usually in .m2 folder); .settings.xml文件中检查您的Maven设置(通常在.m2文件夹中); browse directly to the paths specified in the file or in your pom to verify the connection 直接浏览到文件或pom中指定的路径以验证连接
  4. Check that your jfrog repository is up an running; 检查您的jfrog存储库是否正在运行; try to restart the server and update your project again; 尝试重新启动服务器并再次更新您的项目; check the .m2 folder again (in my case I had xxx.lastupdate files but no jars) 再次检查.m2文件夹(在我的情况下,我有xxx.lastupdate文件,但没有jar)
  5. Check your jfrog log for more details on the problem; 检查您的jfrog日志以获取有关该问题的更多详细信息; check this for more details on how to find the logs: https://www.jfrog.com/confluence/display/RTF/Artifactory+Log+Files 检查此内容以获取有关如何查找日志的更多详细信息: https : //www.jfrog.com/confluence/display/RTF/Artifactory+Log+Files

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 linux上哪种语言(python / perl / tcl)不需要安装第三方库? - which language (python/perl/tcl) on linux doesn't need to install the third-party libs? 我在jar文件中找不到我的库 - I can't find my libs in jar file Maven 在构建我们自己的 custom.jar 时发布和使用第三方运行时 jar - Maven publish & consume the third-party runtime jars while building our own custom.jar 如何将第三方jar文件添加到我的android应用jar文件中? - How to add third-party jar files into my android application jar file? 使用Maven,Spring Boot和无需回购协议的第三方库创建可执行jar失败 - Creation of executable jar with maven, spring boot and repo-less 3rd party libs fail either way 如何在 Windows 10 中使用命令提示符在编译和运行时包含第三方 jar 文件? - How to include a third-party jar-file in compilation and runtime using command prompt in Windows 10? Maven-我可以在应用运行时添加第三方依赖项吗? - Maven - can i include third-party dependencies during app's runtime? 从Eclipse中的第三方jar查看源代码 - Viewing source code from a third-party jar in Eclipse 如何在第三方Maven依赖项中使用执行切入点? - How to use execution pointcut with third-party maven dependency? 使用Bukkit的Minecraft Server中的第三方jar(Twitter4J) - Third-party jar (Twitter4J) in Minecraft Server with Bukkit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM