jfrog / artifactory-maven-plugin

A Maven plugin to resolve artifacts from Artifactory, deploy artifacts to Artifactory, capture and publish build info.
https://www.jfrog.com/confluence/display/JFROG/Maven+Artifactory+Plugin
Apache License 2.0
24 stars 26 forks source link

Maven deploy fails when the classifier string value is too long #29

Closed sandeepanikapati closed 2 years ago

sandeepanikapati commented 2 years ago

Is your feature request related to a problem? Please describe. The maven deploy fails when the classifier attribute has a too-long string value in the pom file. It happens when the classifier string length is more than 64 characters.it gets the following error.

Client logs: Caused by: java.io.IOException: JFrog service failed. Received 400: { "errors" : [ { "status" : 400, "message" : "Could not insert build BuildWrapper(build=Build{version='1.0.1', name='tester/case', number='1643707380032', buildAgent=Maven/3.6.3, agent=artifactory-maven-plugin/3.3.0, started='2022-02-01T14:53:00.032+0530', durationMillis=1762, principal='null', artifactoryPrincipal='sandeep', artifactoryPluginVersion='null', url='null', parentName='null', parentNumber='null', vcs='[revision='714a3c3678157c5332f1ff6737c50cacab4ebb1d', commit message=', branch='', url='https://github.com/tester/test.git']', parentBuildId='null', licenseControl=null, buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@769c9418, org.jfrog.build.api.Module@9b0b8a03, org.jfrog.build.api.Module@fbfb1011], statuses=null, buildDependencies=null, issues=null, governance=null}, buildRepo=artifactory-build-info)" } ] }

Artifactory logs: Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)

Steps to reproduce 1) classifier value in dependency of the child pom file is too long (attached sample Maven project).

Child pom.xml:

<parent> <artifactId>repro-build-info-too-long</artifactId> <groupId>org.sonarsource</groupId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>module-depending-on-long-classifier</artifactId> <name>module-dependeing-on-long-classifier</name> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>module-with-long-classifier</artifactId> <version>${project.version}</version> <classifier>listenablefuture-9999.0-empty-to-avoid-conflict-with-guava-very-long</classifier> </dependency> </dependencies>

Parent pom.xml : <groupId>org.sonarsource</groupId> <artifactId>repro-build-info-too-long</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>repro-build-info-too-long</name> <modules> <module>module-with-long-classifier</module> <module>module-depending-on-long-classifier</module> </modules>

2) Execute the maven deploy command maven deploy -U

Describe the solution you'd like to see Maven deploy command should be successful even though the classifier value is too long.

Additional context

sverdlov93 commented 2 years ago

Hi, @sandeepanikapati and @henryju, artifactory-maven-plugin 3.4.0 is released and should fix the above issue. Looking forward to your feedback on it.

henryju commented 2 years ago

Hi @sverdlov93

I will test on my real use case but I need some time. I will update this thread if the fix doesn't work.

Thanks!

henryju commented 2 years ago

I confirm the issue is fixed on our side using 3.4.0. Thanks!