1

我正在使用 Jfrog 的 Artifactory,并且我已将 repo1.maven.org/maven2 作为远程存储库包含在内,但是当我从我的 IDE 请求特定的工件时,工件不会从远程服务器将其下载到缓存中?知道我在这里缺少什么吗?

编辑:

artifactory.log 显示以下错误消息

2012-01-09 13:08:10,814 [pool-1-thread-15] [INFO ] (o.a.c.h.HttpMethodDirector:445) - Retrying request

2012-01-09 13:08:11,814 [pool-1-thread-15] [WARN ] (o.a.r.RemoteRepoBase:323) - jfrog-libs: Error in getting information for 'opensymphony/quartz/1.6.5/quartz-1.6.5.pom' (Failed retrieving resource from http://repo.jfrog.org/artifactory/libs-release-local/opensymphony/quartz/1.6.5/quartz-1.6.5.pom: Connection refused: connect).

2012-01-09 13:08:13,408 [pool-1-thread-16] [INFO ] (o.a.c.h.HttpMethodDirector:439) - I/O exception (java.net.ConnectException) caught when processing request: Connection refused: connect

下面是项目的 pom.xml 的一部分

<distributionManagement>
        <repository>
            <id>COMPANY_INTERNAL</id>
            <name>COMPANY internal repository</name>
            <url>http://artifactoryserver:18081/artifactory/company</url>
        </repository>
        <snapshotRepository>
            <id>COMPANY_INTERNAL_SNAPSHOTS</id>
            <name>companyinternal snapshot repository</name>
            <url>http://artifactoryserver:18081/artifactory/company</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>COMPANY_PUBLIC</id>
            <name>COMPANY internal and external repository</name>
            <url>http://artifactoryserver:18081/artifactory/repo</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>COMPANY_PLUGINS</id>
            <name>Maven Plugin Repository</name>
            <url>http://artifactoryserver:18081/artifactory/plugins-releases</url>
            <layout>default</layout>
        </pluginRepository>
    </pluginRepositories>

截图

1)本地存储库 2)远程存储库 3)虚拟存储库 4)存储库浏览器

还包括下面的 request.log 内容,

20120110094113|3735|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/com/vividsolutions/jts/1.12-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|311
20120110094114|63|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/com/vividsolutions/jts/1.12-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094114|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/com/vividsolutions/jts/1.12-SNAPSHOT/jts-1.12-SNAPSHOT.pom|HTTP/1.1|304|461
20120110094116|2422|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial/1.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|326
20120110094116|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial/1.0-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094116|0|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial/1.0-SNAPSHOT/hibernate-spatial-1.0-SNAPSHOT.pom|HTTP/1.1|304|1761
20120110094117|0|REQUEST|SERVER_IP_HIDDEN|admin|GET|/webapp/systemlogs.html|HTTP/1.1|200|0
20120110094118|2406|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-maven/1.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|332
20120110094118|15|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-maven/1.0-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094119|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-maven/1.0-SNAPSHOT/hibernate-spatial-maven-1.0-SNAPSHOT.pom|HTTP/1.1|304|8144
20120110094121|2281|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_service_hibernate/5.0.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|317 
20120110094121|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_service_hibernate/5.0.0-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094121|0|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_service_hibernate/5.0.0-SNAPSHOT/companylib_service_hibernate-5.0.0-SNAPSHOT.pom|HTTP/1.1|304|4224
20120110094123|2297|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_domain_parent/5.0.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|313
20120110094123|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_domain_parent/5.0.0-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094123|0|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_domain_parent/5.0.0-SNAPSHOT/companylib_domain_parent-5.0.0-SNAPSHOT.pom|HTTP/1.1|304|13997
20120110094126|2406|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-oracle/1.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|200|333
20120110094126|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-oracle/1.0-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.1|200|40
20120110094126|0|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-oracle/1.0-SNAPSHOT/hibernate-spatial-oracle-1.0-SNAPSHOT.pom|HTTP/1.1|304|1779
20120110094127|15|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial/1.0-SNAPSHOT/hibernate-spatial-1.0-SNAPSHOT.jar|HTTP/1.1|304|77589
20120110094127|16|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/com/vividsolutions/jts/1.12-SNAPSHOT/jts-1.12-SNAPSHOT.jar|HTTP/1.1|304|755797
20120110094127|0|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/company/companylib_service_hibernate/5.0.0-SNAPSHOT/companylib_service_hibernate-5.0.0-SNAPSHOT.jar|HTTP/1.1|304|77835
20120110094127|15|REQUEST|SERVER_IP_HIDDEN|non_authenticated_user|GET|/repo/org/hibernatespatial/hibernate-spatial-oracle/1.0-SNAPSHOT/hibernate-spatial-oracle-1.0-SNAPSHOT.jar|HTTP/1.1|304|62943
20120110094127|15|REQUEST|SERVER_IP_HIDDEN|admin|GET|/webapp/systemlogs.html|HTTP/1.1|200|0
20120110094137|0|REQUEST|SERVER_IP_HIDDEN|admin|GET|/webapp/systemlogs.html|HTTP/1.1|200|0
4

3 回答 3

4

我在您附加的 response.log 中看到,Artifactory 为请求的快照工件返回了HTTP 304(未修改)响应状态(条目右侧的第二列)。

这意味着请求的工件已经存在于本地计算机的缓存中,并且在 Artifactory 中找不到更新的版本。

无论您使用什么工具,都根据本地版本的最后修改时间(即"Last-Modified""If-Modified-Since")请求带有条件标头的此工件;由于找不到较新的版本,重新下载相同的工件是没有意义的,这就是为什么您在 Artifactory 的缓存存储库中看不到它的原因。

于 2012-01-11T15:04:39.333 回答
2

贵公司的网络是否要求您使用代理来访问外部互联网?如果是这样,您需要在 Artifactory 的 Admin/Configuration/Proxies 屏幕中设置该代理,然后对于每个外部 repo Artifactory 充当代理,您需要在 repo 的“高级设置”选项卡上指定此代理。

于 2012-01-09T20:08:59.753 回答
0

I had a fun experience with this same type of error today, but it was on a GET request only (no DEPLOY like the original poster).

In my case the user's ~/.m2/settings.xml was taken from a template file that had:

<server>
    <id>${server-id}</id>
    <username>a-valid-username</username>
    <password>valid-pass</password>
</server>

Later in the settings.xml template that they had copied and modified with their credentials was the repository url.

This caused the behavior that they could hit the server and make the request, but it would never try to authenticate.

They got the authentication denied message, and a "non_authenticated_user" showed up as making a GET request in the request.log.

Once we replaced the bogus/undefined ${server-id} with the server's actual id it started working.

于 2013-10-16T21:40:08.143 回答