簡體   English   中英

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

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

我的團隊正在使用JFrog工件,並且已向其部署了3rd-party庫。

我的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>

工件包含一個pom,這是我自己的項目所依賴的(導入pom的BOM樣式以構建我自己的本地項目)。 看起來maven成功下載了FINE的所有內容,直到到達特定的jar:

無法解析項目xxx:1.1.0的依賴項:無法解析以下工件:com.japisoft:xmlpad-res:jar:3.7

我檢查了一下,jar確實存在於工件(xmlpad-res-3.7.jar)中,但是maven聲稱找不到它。 我嘗試下載jar並使用maven install plugin安裝它,但這沒有幫助。

為什么Maven找不到文件,我該怎么辦?

錯誤地刪除/修改了maven .settings文件時,我遇到了同樣的問題。

要解決此問題,請嘗試以下步驟:

  1. 首先更新.m2文件夾中的本地jar:右鍵單擊您的項目> Maven>更新項目 (選中“ 強制 ”復選框)
  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+Log+Files

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM