JFrog Artifactory-可以搜索虚拟存储库吗?

时间:2018-11-03 03:44:57

标签: artifactory

我正在使用artworkory-java-client-services库获取自特定时间戳记以来创建的工件。我可以使用本地存储库进行连接和搜索,但是使用虚拟存储库时却没有得到响应。

pom:

<groupId>org.jfrog.artifactory.client</groupId>
<artifactId>artifactory-java-client-services</artifactId>
<version>2.3.5</version>

要连接的代码段:

private Artifactory artifactory;
private String url = "https://artifactory.dev.companyfoo.net/artifactory/libs-release-local";
private String repo = "libs-release-local";

private Artifactory getArtifactoryInstance() {
    return artifactory == null ? ArtifactoryClient.create(
            url, "foo_user", "bar_password") : artifactory;
}

要搜索的代码段

protected List<RepoPath> searchArtifactoryByTime(long sinceMillis) {
    log.info("Searching Artifactory for newly created artifacts.");
    List<RepoPath> searchedArtifactPathList = null;
    try {
        searchedArtifactPathList = getArtifactoryInstance().searches()
            .repositories(repo)
            .artifactsCreatedSince(sinceMillis)
            .doSearch();
    } catch (Throwable t) {
        throw new BlahException("Exception occurred while searching Artifactory for newly released artifacts. Message: "
        +t.getMessage());
    }
    return searchedArtifactPathList;
}

此代码适用于本地存储库,但是一旦我使用虚拟存储库,它就会冻结。 我也愿意使用Artifactory REST API,但前提是我绝对无法正常工作。

0 个答案:

没有答案