Java 当版本处于开放端范围时,限制maven依赖项的下载
我有一个带有父POM的多模块maven项目,它定义了几个常见的依赖项,作为依赖项管理的一部分,如下所示:Java 当版本处于开放端范围时,限制maven依赖项的下载,java,maven,nexus,dependency-management,Java,Maven,Nexus,Dependency Management,我有一个带有父POM的多模块maven项目,它定义了几个常见的依赖项,作为依赖项管理的一部分,如下所示: <dependency> <groupId>com.example</groupId> <artifactId>example-commons-core</artifactId> <version>(1.2,)</version> </dependency> <dep
<dependency>
<groupId>com.example</groupId>
<artifactId>example-commons-core</artifactId>
<version>(1.2,)</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>example-commons-logging</artifactId>
<version>(1.3,)</version>
</dependency>
解决此问题的现代方法是避免使用版本范围,但使用版本maven插件(如
versions:use latest releases
)。检查正是使用版本范围引起的。此外,您的构建不再是可复制的。我强烈建议不要使用版本范围。使用固定版本…如果存储库在您的构建中检查了您自己的依赖项,我假设您的构建中有问题…谢谢您的回复!是的,我同意你的看法,使用开放式版本不是最好的主意。我已将POM更改为FEX版本。再次非常感谢!谢谢你的回答!我只是在评估哪些插件可以帮我解决这个问题。
Downloading from snapshots: https://example.com/repository/snapshots/com.example/example-commons-core/maven-metadata.xml
Downloading from release: https://example.com/repository/release/com.example/example-commons-core/maven-metadata.xml
Downloading from 3rdparty: https://example.com/repository/3rdparty/com.example/example-commons-core/maven-metadata.xml
Downloading from central: https://repo1.maven.org/maven2/com.example/example-commons-core/maven-metadata.xml