代码之家  ›  专栏  ›  技术社区  ›  sharon gur

maven依赖uber jar,local vs jenkins

  •  0
  • sharon gur  · 技术社区  · 6 年前

    我有一个项目,它使用某个第三方存储库,并依赖于该repo中的几个jar。

    现在我开始项目B,但我不想让他有第三方回购,因为我所需要的所有类都已经在我在artifactory中的那个胖罐子里了。

    当我在jenkins服务器上构建projectb时,一切都很顺利,但是当我尝试在本地计算机(可以访问artifactory)上编译projectb时,我失败了,因为他在没有第三方存储库的情况下尝试下载projecta的一些依赖项。

    我很清楚,这不是最好的工作方式,但我不明白的是,为什么在我的本地环境我得到错误,而詹金斯没有?

    我想,如果类存在,maven不会尝试从外部repo下载依赖项,而在我的例子中,类存在,如果我进入local.m2 repo,将项目视为jar,我可以看到类存在。

    为什么詹金斯成功了而我没有?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Illya Kysil    6 年前

    <dependency>
        <groupId>groupA</groupId>
        <artifactId>artifactA</artifactId>
        <excludes>
            <exclude>
                <groupId>*</groupId>
                <artifactId>*</artifactId>
            </exclude>
        </excludes>
    </dependency>