gpt4 book ai didi

spring-boot - 如何发布jar到 Artifactory ?

转载 作者:行者123 更新时间:2023-12-03 05:32:29 26 4
gpt4 key购买 nike

我必须将spring boot项目发布到 Artifact ,并且需要在 list 中添加一些信息。我的build.gradle文件如下所示:

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE")
}
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

bootJar {
baseName = 'my-project'
def gitBranch = java.util.Optional.ofNullable(System.getenv('git.branch')).orElse('no information')
def gitCommit = java.util.Optional.ofNullable(System.getenv('git.commit')).orElse('no information')
def gitBuildNumber = java.util.Optional.ofNullable(System.getenv('git.buildno')).orElse('no information')
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
)
}
}

我在 class-path行上遇到如下错误,
A problem occurred evaluating root project 'my-project'.
> Could not resolve all dependencies for configuration ':detachedConfiguration1'.
> Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE because no repositories are defined.
Required by:
project :


如何解决此问题?

最佳答案

如下所示,从dependencies中取出buildScript块。

buildscript {
repositories {
jcenter()
mavenCentral()
}

}

dependencies {
...........
}

关于spring-boot - 如何发布jar到 Artifactory ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58537566/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com