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

targetCompatibility Gradle setting is ignored by Gradle JPI plugin and default Java is used

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have the following settings in my build.gradle file:

      // Jenkins 1.580+ still uses Java 7, not Java 8.
      sourceCompatibility = 1.7
      targetCompatibility = 1.7

      then I run "gradle jpi" on this plugin
      note: the default Java available to Gradle during the build was Java 8.

      then I upload the plugin to a Jenkins server that is running on Java 7.

      I suspect the plugin build ignored "targetCompatibility" because the plugin execution failed in Jenkins:

      ava.lang.VerifyError: Expecting a stackmap frame at branch target 7
      Exception Details:
      Location:
      com/codepine/api/testrail/model/Project.____isAssignableFrom0(Ljava/lang/Class;)Z @0: ldc
      Reason:
      Expected stackmap frame at this location.
      Bytecode:
      0000000: 12bc 2ab6 00c1 ac12 c4ac
      Exception Handler Table:
      bci [0, 7] => handler: 7

      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
      at java.lang.Class.getDeclaredFields(Class.java:1811)
      at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:683)
      at com.fasterxml.jackson.databind.introspect.AnnotatedClass.resolveFields(AnnotatedClass.java:470)
      at com.fasterxml.jackson.databind.introspect.AnnotatedClass.fields(AnnotatedClass.java:282)
      at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addFields(POJOPropertiesCollector.java:380)
      at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collect(POJOPropertiesCollector.java:233)
      at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:142)
      at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:81)
      at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:11)
      at com.fasterxml.jackson.databind.DeserializationConfig.introspect(DeserializationConfig.java:547)
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:325)
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:263)
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
      at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:144)
      at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:366)
      at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:150)
      at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:23)
      at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:572)
      at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:386)
      at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:3095)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2989)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2151)
      at com.codepine.api.testrail.Request.execute(Request.java:164)
      at org.jenkinsci.plugin.trp.TestRailClient.getProjectId(TestRailClient.java:104)
      at org.jenkinsci.plugin.trp.BuildRunListener.processBuildCompletedNotification(BuildRunListener.java:59)
      at org.jenkinsci.plugin.trp.BuildRunListener.onCompleted(BuildRunListener.java:39)
      at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
      at hudson.model.Run.execute(Run.java:1786)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:381)

        Attachments

          Issue Links

            Activity

            alskor Alex Java created issue -
            alskor Alex Java made changes -
            Field Original Value New Value
            Description I have the following settings in my build.gradle file:

            // Jenkins 1.580+ still uses Java 7, not Java 8.
            sourceCompatibility = 1.7
            targetCompatibility = 1.7

            then I run "gradle jpi" on this plugin
            note: the default Java available to Gradle during the build was Java 8.

            then I upload the plugin to a Jenkins server that is running on Java 7.

            turns out the plugin build ignored "targetCompatibility" and the plugin failed in Jenkins:

            {quote}
            ava.lang.VerifyError: Expecting a stackmap frame at branch target 7
            Exception Details:
              Location:
                com/codepine/api/testrail/model/Project.____isAssignableFrom0(Ljava/lang/Class;)Z @0: ldc
              Reason:
                Expected stackmap frame at this location.
              Bytecode:
                0000000: 12bc 2ab6 00c1 ac12 c4ac
              Exception Handler Table:
                bci [0, 7] => handler: 7

            at java.lang.Class.getDeclaredFields0(Native Method)
            at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
            at java.lang.Class.getDeclaredFields(Class.java:1811)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:683)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass.resolveFields(AnnotatedClass.java:470)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass.fields(AnnotatedClass.java:282)
            at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addFields(POJOPropertiesCollector.java:380)
            at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collect(POJOPropertiesCollector.java:233)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:142)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:81)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:11)
            at com.fasterxml.jackson.databind.DeserializationConfig.introspect(DeserializationConfig.java:547)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:325)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:263)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
            at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:144)
            at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:366)
            at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:150)
            at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:23)
            at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:572)
            at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:386)
            at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:3095)
            at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2989)
            at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2151)
            at com.codepine.api.testrail.Request.execute(Request.java:164)
            at org.jenkinsci.plugin.trp.TestRailClient.getProjectId(TestRailClient.java:104)
            at org.jenkinsci.plugin.trp.BuildRunListener.processBuildCompletedNotification(BuildRunListener.java:59)
            at org.jenkinsci.plugin.trp.BuildRunListener.onCompleted(BuildRunListener.java:39)
            at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
            at hudson.model.Run.execute(Run.java:1786)
            at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:381)
            {quote}
            I have the following settings in my build.gradle file:

            // Jenkins 1.580+ still uses Java 7, not Java 8.
            sourceCompatibility = 1.7
            targetCompatibility = 1.7

            then I run "gradle jpi" on this plugin
            note: the default Java available to Gradle during the build was Java 8.

            then I upload the plugin to a Jenkins server that is running on Java 7.

            I suspect the plugin build ignored "targetCompatibility" because the plugin execution failed in Jenkins:

            {quote}
            ava.lang.VerifyError: Expecting a stackmap frame at branch target 7
            Exception Details:
              Location:
                com/codepine/api/testrail/model/Project.____isAssignableFrom0(Ljava/lang/Class;)Z @0: ldc
              Reason:
                Expected stackmap frame at this location.
              Bytecode:
                0000000: 12bc 2ab6 00c1 ac12 c4ac
              Exception Handler Table:
                bci [0, 7] => handler: 7

            at java.lang.Class.getDeclaredFields0(Native Method)
            at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
            at java.lang.Class.getDeclaredFields(Class.java:1811)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:683)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass.resolveFields(AnnotatedClass.java:470)
            at com.fasterxml.jackson.databind.introspect.AnnotatedClass.fields(AnnotatedClass.java:282)
            at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addFields(POJOPropertiesCollector.java:380)
            at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collect(POJOPropertiesCollector.java:233)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:142)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:81)
            at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:11)
            at com.fasterxml.jackson.databind.DeserializationConfig.introspect(DeserializationConfig.java:547)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:325)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:263)
            at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
            at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:144)
            at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:366)
            at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:150)
            at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:23)
            at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:572)
            at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:386)
            at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:3095)
            at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2989)
            at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2151)
            at com.codepine.api.testrail.Request.execute(Request.java:164)
            at org.jenkinsci.plugin.trp.TestRailClient.getProjectId(TestRailClient.java:104)
            at org.jenkinsci.plugin.trp.BuildRunListener.processBuildCompletedNotification(BuildRunListener.java:59)
            at org.jenkinsci.plugin.trp.BuildRunListener.onCompleted(BuildRunListener.java:39)
            at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
            at hudson.model.Run.execute(Run.java:1786)
            at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:381)
            {quote}
            alskor Alex Java made changes -
            Resolution Cannot Reproduce [ 5 ]
            Status Open [ 1 ] Closed [ 6 ]
            alskor Alex Java made changes -
            Link This issue is related to JENKINS-28781 [ JENKINS-28781 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 164675 ] JNJira + In-Review [ 209072 ]

              People

              Assignee:
              daspilker Daniel Spilker
              Reporter:
              alskor Alex Java
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: