_remote.repositories阻止maven解析远程父级

_remote.repositories阻止maven解析远程父级,maven,maven-3,nexus,maven-dependency-plugin,Maven,Maven 3,Nexus,Maven Dependency Plugin,我在公司Nexus实例的发行版存储库中有我的公司父pom 我有external:*的镜像设置,!central,我不想代理central,因为我们的Nexus有点慢 当我有一个maven项目时,父项设置如下: <parent> <groupId>com.acme.maven</groupId> <artifactId>parent-pom</artifactId> <version>2</ver

我在公司Nexus实例的
发行版
存储库中有我的公司父pom

我有
external:*的镜像设置,!central
,我不想代理central,因为我们的Nexus有点慢

当我有一个maven项目时,父项设置如下:

<parent>
    <groupId>com.acme.maven</groupId>
    <artifactId>parent-pom</artifactId>
    <version>2</version>
    <relativePath />
</parent>
现在,如果我从
.m2/repository/com/acme/maven/parent pom/2/
中删除
\u remote.repositories
文件(仅该文件),构建将成功

我有一些解决方法,但是手动从maven存储库中删除内部文件听起来不是个好主意。如何避免它? 我也不知道为什么会发生这种情况,请解释一下

其他办法:

  • maven ant tasks
    依赖项
    task有效(
    \u remote.repositories
    文件根本不出现)
  • 正在尝试使用
    -U
  • 使用依赖项:复制失败
  • pom.xml
    上使用
    dependency:list
    父pom
    作为依赖项也会失败

\u远程存储库
内容:

#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Mon Sep 14 19:59:41 CEST 2015
parent-pom-2.pom>internal-repo=
我认为答案是:

Maven 3.0+强制要求从 与当前存储库的可用url匹配的存储库url/id 会议

IIRC在Maven 3.1.1中有一个CLI选项,您可以启用该选项 告诉Maven“我知道我在做什么,不要做那个检查 时间“即。 --遗留本地存储库

实际上,将
--legacy local repository
添加到
依赖项:get
调用会使其不会生成
\u remote.repositories
,并且可以解析
父pom

我认为,Ant的
依赖性
任务行为可以用它使用Maven 2代码来解释

#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Mon Sep 14 19:59:41 CEST 2015
parent-pom-2.pom>internal-repo=