【问题标题】:Does the repos in maven not have jar files?maven中的repos没有jar文件吗?
【发布时间】:2019-04-10 21:22:22
【问题描述】:

我尝试过浏览各种 repos,但是我找不到包含此依赖项的 jar 文件的一个:

<dependency>
    <groupId>com.oracle.java</groupId>
    <artifactId>jre</artifactId>
    <version>1.8.0_131</version>
</dependency>

我得到的错误:无法解析项目 com.blackducksoftware.test:example-maven-travis:jar:0.1.0-SNAPSHOT 的依赖项:找不到工件 com.oracle.java:jre:jar:1.8.0_131在 jboss (http://repository.jboss.org/nexus/content/groups/public-jboss)

repo 中只有 pom 文件而不是 jar 文件有什么原因吗? 如何获取jar文件?

【问题讨论】:

    标签: maven


    【解决方案1】:

    From mvnrepository.com:

    注意:此工件位于 Alfresco 存储库 (https://artifacts.alfresco.com/nexus/content/repositories/public/)

    因此,您需要将配置文件条目添加到您的 settings.xml 文件中。

    示例:

     <profile>
                <id>alfresco-repo</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <repositories>
                    <repository>
                        <id>alfresco-repo</id>
                        <name>Alfresco Repository</name>
                        <url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    </repository>
                </repositories>
            </profile>
    

    【讨论】:

    • 是的,我已经尝试过这个存储库。但是我的意思是没有 .jar 文件。因此出现错误消息。
    • 我看到它包含 tar 档案而不是 jar。我想知道为什么您需要将此作为依赖项包含在内?这不应该安装在系统级别吗?
    • 我正在尝试使用 owasp 插件来查找 cves。所以我正在尝试将 jre 添加到依赖项中。
    猜你喜欢
    • 1970-01-01
    • 2018-06-08
    • 1970-01-01
    • 2020-05-20
    • 2017-01-11
    • 1970-01-01
    • 1970-01-01
    • 2017-02-13
    • 2017-05-09
    相关资源
    最近更新 更多