首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将Jar文件作为新版本发布到jfrog中,而不是删除/覆盖

如何将Jar文件作为新版本发布到jfrog中,而不是删除/覆盖
EN

Stack Overflow用户
提问于 2022-11-30 08:04:27
回答 1查看 26关注 0票数 0

我正在尝试将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文件的样子。

代码语言:javascript
复制
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文件来实现呢?

EN

回答 1

Stack Overflow用户

发布于 2022-12-01 03:16:42

我认为快照回购可能是解决方案,你可以保存许多不同的版本,你喜欢。

https://jfrog.com/knowledge-base/artifactory-how-does-the-max-unique-snapshots-parameter-work-in-artifactory/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74624556

复制
相关文章

相似问题

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