java—将快照jar发布到ArtifactoryMaven存储库失败

vwkv1x7d  于 2021-07-06  发布在  Java
关注(0)|答案(2)|浏览(442)

我的团队正在尝试将jenkins作业生成的jar部署到artifactorypro7.6.2示例中的存储库中,该示例被设置为maven快照repo。但是,当从项目执行生成的jar文件的实际上载时,部署失败,并出现错误500。
这是jenkins作业的控制台输出:

[consumer_0] Deploying artifact: http://<artifactory URL>/maven-dev/com/example/example-client/0.0.1-SNAPSHOT/example-client-0.0.1-20200817.130343-1-javadoc.jar
[consumer_1] Deploying artifact: http://<artifactory URL>/maven-dev/com/example/example-client/0.0.1-SNAPSHOT/example-client-0.0.1-20200817.130343-1-sources.jar
[consumer_2] Deploying artifact: http://<artifactory URL>/maven-dev/com/example/example-client/0.0.1-SNAPSHOT/example-client-0.0.1-20200817.130343-1.jar
[consumer_1] Deploying artifact: http://<artifactory URL>/maven-dev/com/example/example-client/0.0.1-SNAPSHOT/example-client-0.0.1-20200817.130343-1.module
[consumer_0] An exception occurred during execution:
java.lang.RuntimeException: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors: 
 Status code: 500
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
    at org.jfrog.build.extractor.producerConsumer.ConsumerRunnableBase.run(ConsumerRunnableBase.java:11)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors: 
 Status code: 500
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:685)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.doDeployArtifact(ArtifactoryBuildInfoClient.java:367)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:355)
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:39)
    ... 2 more

[consumer_1] An exception occurred during execution:
java.lang.RuntimeException: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors: 
 Status code: 500
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
    at org.jfrog.build.extractor.producerConsumer.ConsumerRunnableBase.run(ConsumerRunnableBase.java:11)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors: 
 Status code: 500
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:685)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.doDeployArtifact(ArtifactoryBuildInfoClient.java:367)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:355)
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:39)
    ... 2 more

在artifactory服务器端,当此操作失败时,日志中会显示以下内容(对于每个失败的文件都会重复此操作,这里只放一个示例):

2020-08-18T22:27:33.042Z [jfrt ] [ERROR] [6c7ca1a483dd3f03] [o.a.r.d.DbStoringRepoMixin:291] [tp-nio-8081-exec-407] - Couldn't save resource maven-dev:com/example/example-client/0.0.1-SNAPSHOT/example-client-0.0.1-20200818.222406-1-sources.jar, reason:
java.lang.reflect.UndeclaredThrowableException: null
    at com.sun.proxy.$Proxy46.next(Unknown Source)
    at org.artifactory.storage.db.fs.dao.NodesDao.getChildren(NodesDao.java:247)
    at org.artifactory.storage.db.fs.service.FileServiceImpl.loadChildren(FileServiceImpl.java:272)
    at org.artifactory.storage.fs.tree.FolderNode.getChildrenItemNode(FolderNode.java:74)
    at org.artifactory.storage.fs.tree.FolderNode.getChildren(FolderNode.java:56)
    at org.artifactory.maven.MavenMetadataCalculator.folderContainsPoms(MavenMetadataCalculator.java:422)
    at org.artifactory.maven.MavenMetadataCalculator.createSnapshotsMetadata(MavenMetadataCalculator.java:210)
    at org.artifactory.maven.MavenMetadataCalculator.calculateAndSet(MavenMetadataCalculator.java:179)
    at org.artifactory.maven.MavenMetadataCalculator.calculate(MavenMetadataCalculator.java:154)
    at org.artifactory.maven.MavenMetadataServiceImpl.calculateMavenMetadata(MavenMetadataServiceImpl.java:86)
    at jdk.internal.reflect.GeneratedMethodAccessor5156.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
    at com.sun.proxy.$Proxy242.calculateMavenMetadata(Unknown Source)
    at org.artifactory.repo.interceptor.MavenMetadataCalculationInterceptor.afterCreate(MavenMetadataCalculationInterceptor.java:73)
    at org.artifactory.repo.interceptor.storage.StorageInterceptorsImpl.afterCreate(StorageInterceptorsImpl.java:69)
    at jdk.internal.reflect.GeneratedMethodAccessor459.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
    at com.sun.proxy.$Proxy234.afterCreate(Unknown Source)
    at org.artifactory.repo.db.DbStoringRepoMixin.invokeAfterCreateInterceptors(DbStoringRepoMixin.java:407)
    at org.artifactory.repo.db.DbStoringRepoMixin.saveResource(DbStoringRepoMixin.java:245)
    at org.artifactory.repo.db.DbLocalRepo.saveResource(DbLocalRepo.java:162)
    at org.artifactory.repo.service.RepositoryServiceImpl.saveResourceInTransaction(RepositoryServiceImpl.java:1915)
    at jdk.internal.reflect.GeneratedMethodAccessor477.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy193.saveResourceInTransaction(Unknown Source)
    at org.artifactory.repo.service.RepositoryServiceImpl.saveResource(RepositoryServiceImpl.java:1903)
    at jdk.internal.reflect.GeneratedMethodAccessor526.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
    at com.sun.proxy.$Proxy193.saveResource(Unknown Source)
    at org.artifactory.engine.UploadServiceImpl.uploadItemWithContent(UploadServiceImpl.java:574)
    at org.artifactory.engine.UploadServiceImpl.uploadItemWithProvidedContent(UploadServiceImpl.java:554)
    at org.artifactory.engine.UploadServiceImpl.uploadItem(UploadServiceImpl.java:429)
    at org.artifactory.engine.UploadServiceImpl.uploadFile(UploadServiceImpl.java:420)
    at org.artifactory.engine.UploadServiceImpl.uploadArtifact(UploadServiceImpl.java:402)
    at org.artifactory.engine.UploadServiceImpl.adjustResponseAndUpload(UploadServiceImpl.java:223)
    at org.artifactory.engine.UploadServiceImpl.validateRequestAndUpload(UploadServiceImpl.java:189)
    at org.artifactory.engine.UploadServiceImpl.upload(UploadServiceImpl.java:132)
    at jdk.internal.reflect.GeneratedMethodAccessor520.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.artifactory.request.aop.RequestAdvice.invoke(RequestAdvice.java:67)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy238.upload(Unknown Source)
    at org.artifactory.webapp.servlet.RepoFilter.doUpload(RepoFilter.java:284)
    at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:176)
    at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:97)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.artifactory.webapp.servlet.AccessFilter.useAuthenticationAndContinue(AccessFilter.java:413)
    at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:301)
    at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:176)
    at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:127)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:78)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.artifactory.webapp.servlet.ArtifactoryCsrfFilter.doFilter(ArtifactoryCsrfFilter.java:86)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:164)
    at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80)
    at org.artifactory.webapp.servlet.SessionFilter.doFilter(SessionFilter.java:62)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.artifactory.webapp.servlet.ArtifactoryTracingFilter.doFilter(ArtifactoryTracingFilter.java:27)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:126)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
    at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:305)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException: null
    at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jfrog.storage.wrapper.ResultSetWrapper.invoke(ResultSetWrapper.java:85)
    ... 109 common frames omitted
Caused by: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, NODES, (2975,6)
  Waiting XID : {230127895, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {230127897, X} 
Lock : ROW, NODES, (991,272)
  Waiting XID : {230127897, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {230127895, X} 
. The selected victim is XID : 230127895.
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
    at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
    ... 113 common frames omitted
Caused by: org.apache.derby.iapi.error.StandardException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, NODES, (2975,6)
  Waiting XID : {230127895, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {230127897, X} 
Lock : ROW, NODES, (991,272)
  Waiting XID : {230127897, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {230127895, X} 
. The selected victim is XID : 230127895.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.services.locks.Deadlock.buildException(Unknown Source)
    at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown Source)
    at org.apache.derby.impl.services.locks.ConcurrentLockSet.zeroDurationLockObject(Unknown Source)
    at org.apache.derby.impl.services.locks.AbstractPool.zeroDurationlockObject(Unknown Source)
    at org.apache.derby.impl.services.locks.ConcurrentPool.zeroDurationlockObject(Unknown Source)
    at org.apache.derby.impl.store.raw.xact.RowLocking2nohold.lockRecordForRead(Unknown Source)
    at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
    at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
    at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown Source)
    at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown Source)
    at org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown Source)
    at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown Source)
    at org.apache.derby.impl.store.access.btree.BTreeScan.fetchNextGroup(Unknown Source)
    at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reloadArray(Unknown Source)
    at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.getNextRowCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.getNextRowCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(Unknown Source)
    ... 115 common frames omitted

jenkins作业是一个声明性的多分支管道,通过jenkins文件中的以下代码完成工件部署:

...
    dir("mavenOut/snapshot/"){
        rtBuildInfo(maxBuilds: 10)

        rtUpload(
            serverId: "artifactory", 
            spec: """{
                "files":[
                    {
                        "pattern": "**/*",
                        "excludePatterns": ["*maven-metadata.xml", "*.sha1","*.sha256","*.sha512","*.md5"],
                        "target":  "maven-dev/",
                        "flat": "false"
                    }
                ]
            }"""
        )

        rtPublishBuildInfo(serverId: "artifactory")
    }
...

该项目本身是一个用gradle构建的java项目:

plugins {
    id 'java-library'
    id 'maven-publish'
    id 'maven'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'javax.websocket:javax.websocket-api:1.0'
    implementation 'org.springframework:spring-websocket:5.2.7.RELEASE'
    implementation 'org.springframework:spring-messaging:5.2.7.RELEASE'
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.2'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.37'

    testCompile('org.springframework.boot:spring-boot-starter-test:2.3.0.RELEASE') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

java {
    withJavadocJar()
    withSourcesJar()
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifactId = 'example-client'
            from components.java
        }
    }
    repositories {
        maven {
            def releasesRepoUrl = "$buildDir/mavenOut/release"
            def snapshotsRepoUrl = "$buildDir/mavenOut/snapshot"
            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
        }
    }
}

test {
    useJUnitPlatform()
}

最终,我们得到了5个需要部署的文件(当然,每个构建的时间戳都会改变):
示例-client-0.0.1-20200817.130343-1.jar
示例-client-0.0.1-20200817.130343-1-javadoc.jar
示例-client-0.0.1-20200817.130343-1-sources.jar
示例-client-0.0.1-20200817.130343-1.module
示例-client-0.0.1-20200817.130343-1.pom
artifactory中的maven存储库(maven dev)使用以下设置进行设置:
校验和策略:根据客户端校验和进行验证
maven快照版本行为:唯一
最大唯一快照数:
控制柄释放:未选中
处理快照:选中
抑制pom一致性检查:选中
我希望其他人已经将这样的项目部署到人工回购中,以指出哪里出了问题。我们已经广泛使用artifactory很多年了,但是在将快照构建部署到maven存储库的上下文中没有。
编辑:我已经缩小了问题的范围,除了主jar和*-javadoc.jar之外,我们还尝试上传*-sources.jar。如果我将文件规范中的排除过滤器更新为以下内容,那么发布将如预期的那样完美地工作:

"excludePatterns": ["*maven-metadata.xml","*.sha1","*.sha256","*.sha512","*.md5","*sources.jar"],

所以关于sources.jar的一些东西被发布了,有什么想法吗?
编辑2:排除jar为多个构建工作的源代码之后,它又开始失败,并出现相同的错误。它将在一两个构建中工作,然后失败一段时间,然后返回到一些看起来成功的地方。
编辑3:我还尝试通过artifactorygradle语法而不是更通用的语法进行部署 rtUpload 接近。gradle构建运行,buildinfo发布,但是没有上传任何工件。

**编辑4:**我得到它的工作基于以下建议。我还将artifactoryjenkins插件更新为最新版本。下面是jenkinsfile中的一个片段,它最终可以正常工作,以防其他人遇到类似的问题。

stage('Artifactory Config') {
        steps {
            rtBuildInfo(maxBuilds: 10, deleteBuildArtifacts: true)

            rtGradleDeployer(
                id: "rtDeployer",
                serverId: "artifactory",
                releaseRepo: "gradle-release",
                snapshotRepo: "gradle-dev"
            )

            rtGradleResolver(
                id: "rtResolver",
                serverId: "artifactory",
                repo: "maven"
            )
        }
    }

    stage('Build Client'){
        steps {
            echo "invoking gradle"

            rtGradleRun(
                tasks: "artifactoryPublish",
                useWrapper: true,
                deployerId: "rtDeployer",
                resolverId: "rtResolver"
            )

            rtPublishBuildInfo(serverId: "artifactory")
        }
    }
q5iwbnjs

q5iwbnjs1#

我建议使用jenkins artifactory插件中提供的专用gradle集成来构建和部署gradle工件。
这可能会避免像您现在面临的那些问题,因为它是专门为gradle构建开发的,与通用命令不同( rtUpload )您当前正在使用。
请参阅这个jenkinsfile示例,了解如何在管道中轻松使用此集成。

aydmsdu9

aydmsdu92#

根据错误日志片段,我可以看到错误与db事务中的死锁有关。我认为artifactory是用默认的derby db运行的。下面的错误日志片段告诉我们derby中存在死锁情况,
原因:org.apache.derby.iapi.error.standardexception:由于死锁而无法获取锁,锁和等待程序的循环是:lock:row,nodes,(2975,6)waiting xid:{230127895,s},app,select*from nodes where repo=?节点路径=?深度=?授权xid:{230127897,x}锁:行,节点,(991272)等待xid:{230127897,s},应用,从repo=?节点路径=?深度=?授权xid:{230127895,x}
我有一个类似的jenkinfile,它将工件部署到artifactory中,从未遇到过这个问题。我相信只要重新启动artifactory就足以将derby db从死锁状态中移除。

相关问题