Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47197

Pipeline Model Definition v1.2 requires java8

    XMLWordPrintable

Details

    Description

      Updating the pipeline-model-definition plugin to v1.2 not only beaks the running jobs, as advertised, but also all pipelines, as introduces a dependency with java 8. This java version is only required for jenkins v2.73, but for the plugin only v2.7 is needed.

      I attach a simple pipeline that produces the error, and the error itself.

      I see in the changelog some problems with compiling the plugin with the wrong java version, so I suspect this may be the same case.

      Attachments

        1. error.txt
          9 kB
        2. pipeline.txt
          0.1 kB

        Issue Links

          Activity

            abayer Andrew Bayer added a comment -

            Auuuuuugh. Yeah, I see the problem - bumping to maven-hpi-plugin version 2.0 (with the plugin parent POM update to 2.35) means we have to use JDK8 to compile Declarative now...which should be fine, you'd think, since we're still targeting Java 7. But nope, for some reason, that damned java.util.function.Function class ends up getting referenced somewhere. Grrrr. Let me try to find a solution.

            abayer Andrew Bayer added a comment - Auuuuuugh. Yeah, I see the problem - bumping to maven-hpi-plugin version 2.0 (with the plugin parent POM update to 2.35) means we have to use JDK8 to compile Declarative now...which should be fine, you'd think, since we're still targeting Java 7. But nope, for some reason, that damned java.util.function.Function class ends up getting referenced somewhere. Grrrr. Let me try to find a solution.
            abayer Andrew Bayer added a comment -

            Seems to specifically be a problem with this line in MappedClosure - something weird about how Groovy compiles down @Delegate for a Map with Java 8 (even when targeting Java 7) results in too much magic with Function.class and friends getting involved. I think I've got a fix, but I need to test it more.

            abayer Andrew Bayer added a comment - Seems to specifically be a problem with this line in MappedClosure - something weird about how Groovy compiles down @Delegate for a Map with Java 8 (even when targeting Java 7) results in too much magic with Function.class and friends getting involved. I think I've got a fix, but I need to test it more.
            abayer Andrew Bayer added a comment -

            Pretty sure I nailed it with https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/205 - no more references to java.util.function.Function in the bytecode. Still need to do a Java 7 manual test at some point before releasing, though.

            abayer Andrew Bayer added a comment - Pretty sure I nailed it with https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/205 - no more references to java.util.function.Function in the bytecode. Still need to do a Java 7 manual test at some point before releasing, though.
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

            People

              abayer Andrew Bayer
              rogerfc Roger Firpo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: