jcgay/maven-profiler

Does not work on Jenkins (maven-plugin)

danieldestro opened this issue · 5 comments

I am able to run properly on command line when copying the JAR file to Maven lib/ext dir.
But when running on Jenkins with Maven-plugin it does not work at all. Jenkins and the plugin does not recognize the JAR in lib/ext, not even on lib dir.
What can I do to get it working on Jenkins (2.32.2)?

jcgay commented

I know it works with Jenkins freestyle project but the Maven style jobs are treated differently in Jenkins.
Based on these issues https://issues.jenkins-ci.org/browse/JENKINS-28629 and https://issues.jenkins-ci.org/browse/JENKINS-30058 it seems broken for now.

We use the profiler for jenkins builds.

Unfortunately it will work only with the "Invoke Top-Level Maven Targets" steps.
It will NOT work in the main step of the Maven job though.

A cheap migration path for Maven jobs is as follows.
Run some noop like help:evaluate in the main Maven job and then move the actual processing to a "Post Build Step" section.

PS. We also use a modified Maven 339 distro with the profiler added inside, I'm not sure if that is needed though.

PS2. Note Pipeline Maven Plugin supports this out of the box

I wanted to upload a screenshot to illustrate, but github keeps failing with "Something went really wrong, and we can’t process that file."

jcgay commented

Feel free to re-open if it's still actual.