相关疑难解决方法(0)

如何阻止Maven 2.x尝试在每次构建时检索不存在的pom.xml文件以获取依赖项?

在我的项目中,有许多依赖项可传递地包含在其他依赖项中,这些依赖项没有任何公司存储库中提供的pom.xml文件.这些是由各个团队支持的内部jar专用库,为了方便起见,这些库已经上传到存储库中,但不幸的是,这些存储库不是我可以使用的.

对于这些依赖项,Maven坚持每次运行构建时都尝试从每个存储库列表中检索poms,或者mvn dependency:list.这意味着maven尝试从7个不同的存储库位置检索8x pom文件,并且这是通过全球企业WAN进行的; 它真的很慢.

例如,对于一个特定的依赖

C:\Working\dev\workspace\project>mvn dependency:list
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building project
[INFO]    task-segment: [dependency:list]
[INFO] ------------------------------------------------------------------------
[WARNING] Unable to get resource 'aGroupId:anArtifactId:pom:4.0.14i' from repository inhouse (http://someRepo1/proximity/repository/inhouse): While configuring wagon for 'inhouse': Unable to apply wagon configuration.
Downloading: http://someRepo1/proximity/repository/extFree/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository extFree (http://someRepo1/proximity/repository/extFree)
Downloading: http://someRepo1/proximity/repository/externalNonFree/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository extNonFree (http://someRepo1/proximity/repository/externalNonFree)
Downloading: http://someRepo2/efs/dist/maven/maven2-repository/incr/common/lib/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable …
Run Code Online (Sandbox Code Playgroud)

dependencies maven-2 artifacts repository

10
推荐指数
1
解决办法
9058
查看次数

Maven安装文件不会生成pom.xml

我使用以下命令在我的存储库中安装了一些第三方jar:

mvn install:install-file -Dfile=/home/anotherCoder/Downloads/nifty-1.0.jar -DgroupId=nifty-gui -DartifactId=nifty-gui -Dversion=1.0 -Dpackaging=jar
Run Code Online (Sandbox Code Playgroud)

但是,一旦我进行mvn编译,maven就会抱怨存储库中没有pom文件并尝试下载它,但不能导致它不会在任何远程存储库中发布.

以下是来自maven的确切消息:

Downloading: http://repo1.maven.org/maven2/nifty-gui/nifty-gui/1.0/nifty-gui-1.0.pom
[INFO] Unable to find resource 'nifty-gui:nifty-gui:pom:1.0' in repository central (http://repo1.maven.org/maven2)
Run Code Online (Sandbox Code Playgroud)

那么我如何让maven为该jar生成一个pom文件并将其放在我的本地存储库中?

maven-2 nifty-gui

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

maven-2 ×2

artifacts ×1

dependencies ×1

nifty-gui ×1

repository ×1