我正在尝试将jar文件发布到jfrog中。一开始很好。但是,当我多次尝试在同一路径下部署工件时,将应用程序版本更改为2.0.0(在1.0.0之前),就会出现此错误。
“消息”:“没有足够的权限删除/覆盖工件'customer-service:customer-service/com/customer/service/core/1.0.0/customer_ervice_core-1.0.0.jar‘(用户:’用户名‘需要删除权限)。”
这就是我的build.gradle文件的样子。
import org.springframework.boot.gradle.plugin.SpringBootPlugin
buildscript {
repositories {
jcenter()
}
dependencies {
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
}
}
plugins {
id 'org.springframework.boot' version '2.7.5' apply false
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
id 'maven-publish'
id 'com.jfrog.artifactory' version '4.28.1'
}
allprojects {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'customer_service_core'
from components.java
pom {
name = 'Customer service core module'
description = 'Customer service core module'
}
}
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
jar {
enabled = true
}
publish {
repository {
repoKey = 'customer-service'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
}
group = 'com.customer.service'
version = '2.0.0'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// lombok dependencies
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}我想知道是否有任何方法可以将我们的jar文件部署为一个新版本,而不覆盖这个新版本呢?我是否总是需要在要部署的路径中手动包含版本号,如果需要,那么如何通过这个build.gradle文件来实现呢?
发布于 2022-12-01 03:16:42
我认为快照回购可能是解决方案,你可以保存许多不同的版本,你喜欢。
https://stackoverflow.com/questions/74624556
复制相似问题