jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
114 stars 186 forks source link

`rtMavenRun` fails with Maven 3.9.2 because `dependenciesValidators` is `null` #828

Closed kiwi-oss closed 1 year ago

kiwi-oss commented 1 year ago

Describe the bug We use the Maven Wrapper and rtMavenRun to execute our builds on Jenkins. It works fine with Maven 3.9.1, but with 3.9.2, it fails consistently in all projects with the message that dependenciesValidators is null. Here's one example of a call and corresponding log:

rtMavenRun(
    goals: 'versions:set --define newVersion=1.1.30-PR-19-20230614192843-SNAPSHOT',
    resolverId: 'MVN_RESOLVER',
    deployerId: 'MVN_DEPLOYER',
    pom: 'pom.xml',
    useWrapper: true
)
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager - Plugin validation issues were detected in 3 plugin(s)
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager - 
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager -  * org.apache.maven.plugins:maven-site-plugin:3.12.1
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager -  * org.openapitools:openapi-generator-maven-plugin:6.6.0
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager -  * org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager - 
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager - For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
WARNING org.apache.maven.plugin.internal.DefaultPluginValidationManager - 
ERROR org.apache.maven.cli.MavenCli - Cannot invoke "java.util.List.iterator()" because "this.dependenciesValidators" is null

Running with --define maven.plugin.validation=VERBOSE didn't provide any information that seems useful, just some warnings about possible issues with Maven 4.

It fails no matter if the job is run on a GCP agent or on the Jenkins controller. The only difference is that on the controller, the final error message is just "NullPointerException".

When running the same execution locally via mvnw, the build succeeds. There, one more plugin with validation issues is reported:

[WARNING] Plugin validation issues were detected in 4 plugin(s)
[WARNING] 
[WARNING]  * org.apache.maven.plugins:maven-site-plugin:3.12.1
[WARNING]  * org.openapitools:openapi-generator-maven-plugin:6.6.0
[WARNING]  * org.codehaus.mojo:versions-maven-plugin:2.15.0
[WARNING]  * org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184

To Reproduce Create a project with the Maven Wrapper configured to use Maven 3.9.2 and execute any goal, e.g. package, via rtMavenRun in the Jenkinsfile.

Expected behavior The build should pass like it did with Maven 3.9.1 and like it does with 3.9.2 locally.

Versions

yahavi commented 1 year ago

@kiwi-oss We have released Jenkins Artifactory plugin 3.18.4 with the fix. This version will be available in the Jenkins Plugins manager in a few hours. Please feel free to upgrade and provide us with your feedback.

kiwi-oss commented 1 year ago

Thank you very much, I will report back once I have tested with 3.18.4!

kiwi-oss commented 1 year ago

That fixed it, our builds pass now. Thanks again!