这不是关于Nexus设置的问题,而是关于build.gradle设置的问题。
我设置了一个内部Nexus repo,我们的Gradle构建从我们的内部Nexus repo中获得了99%的工件。然而,例如,我仍然看到这些来自外部repos的下载。我在我的Nexus中定义了https://plugins.gradle.org/m2和https://repo1.maven.org/maven2。
我的build.gradle里有这个
repositories {
mavenLocal()
maven {
url "https://ourNexusRepo.company.com"
credentials {
username "user"
password "password"
}
}
}
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/1.4.6.RELEASE/spring-boot-gradle-plugin-1.4.6.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tools/1.4.6.RELEASE/spring-boot-loader-tools-1.4.6.RELEASE.jar
Download https://plugins.gradle.org/m2/io/spring/gradle/dependency-management-plugin/0.6.1.RELEASE/dependency-management-plugin-0.6.1.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-core/4.3.8.RELEASE/spring-core-4.3.8.RELEASE.jar
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
Download https://plugins.gradle.org/m2/com/moowork/gradle/gradle-node-plugin/1.1.1/gradle-node-plugin-1.1.1.pom
Download https://plugins.gradle.org/m2/com/moowork/gradle/gradle-node-plugin/1.1.1/gradle-node-plugin-1.1.1.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.4.RELEASE/spring-boot-gradle-plugin-1.4.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-tools/1.4.4.RELEASE/spring-boot-tools-1.4.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-parent/1.4.4.RELEASE/spring-boot-parent-1.4.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/1.4.4.RELEASE/spring-boot-dependencies-1.4.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/spring-framework-bom/4.3.6.RELEASE/spring-framework-bom-4.3.6.RELEASE.pom我在build.gradle中遗漏了什么
发布于 2021-09-17 03:11:39
这是答案的一部分。一旦我找到原因,我会更新的。
插件由settings.gradle中的pluginManagement{}块管理,如下所示
pluginManagement {
repositories {
mavenLocal()
maven {
url "https://ourNexusRepo.company.com"
credentials {
username "user"
password "password"
}
}
}
}我们的Gradle插件现在可以从我们的内部资源库中下载。然而,我仍然看到这些
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.4.RELEASE/spring-boot-gradle-plugin-1.4.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-tools/1.4.4.RELEASE/spring-boot-tools-1.4.4.RELEASE.pomhttps://stackoverflow.com/questions/65243703
复制相似问题