首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置我的build.gradle存储库,以便从我们的内部Nexus中提取这些存储库?

如何设置我的build.gradle存储库,以便从我们的内部Nexus中提取这些存储库?
EN

Stack Overflow用户
提问于 2020-12-11 07:22:18
回答 1查看 25关注 0票数 0

这不是关于Nexus设置的问题,而是关于build.gradle设置的问题。

我设置了一个内部Nexus repo,我们的Gradle构建从我们的内部Nexus repo中获得了99%的工件。然而,例如,我仍然看到这些来自外部repos的下载。我在我的Nexus中定义了https://plugins.gradle.org/m2https://repo1.maven.org/maven2

我的build.gradle里有这个

代码语言:javascript
复制
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中遗漏了什么

EN

回答 1

Stack Overflow用户

发布于 2021-09-17 03:11:39

这是答案的一部分。一旦我找到原因,我会更新的。

插件由settings.gradle中的pluginManagement{}块管理,如下所示

代码语言:javascript
复制
pluginManagement {
  repositories {
    mavenLocal()
    maven {
      url "https://ourNexusRepo.company.com"
      credentials {
        username "user"
        password "password"
      }
    }
  }
}

我们的Gradle插件现在可以从我们的内部资源库中下载。然而,我仍然看到这些

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65243703

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档