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

classes from "junit" Jenkins plugin are not available in class path in IDEA

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • gradle-jpi-plugin
    • None

      I have a Gradle-based Jenkins plugin.
      I'm trying to collect test results from a Jenkins build similarly how it is done in "logstash" plugin (which is Maven-based):
      https://github.com/jenkinsci/logstash-plugin

      I need to access hundson.tasks.test.AbstractTestResultAction class, which is now moved from Jenkins Core to Jenkins Junit plugin.

      the problem is that if I declare the dependency as

              jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar'
      

      , then my Gradle command-line build ("gradle jpi") works fine, but this class (and all classes from that library are not available in Jetbrains IDEA).
      and if I declare it as

              jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6'
      

      , then it becomes visible in IDEA, but command-line build starts to fail:

      /.../src/main/java/org/jenkinsci/plugins/jpp/BuildMessageBuilder.java:9: error: package hudson.tasks.test does not exist
      import hudson.tasks.test.AbstractTestResultAction;
      ^
      1 error

      it may be a bug in IDEA rather than jpi plugin, of course. but maybe there is something that can be done in the plugin to simplify IDEA's dependency resolution?..

          [JENKINS-29327] classes from "junit" Jenkins plugin are not available in class path in IDEA

          Alex Java created issue -
          Alex Java made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Alex Java made changes -
          Description Original: I have a Gradle-based Jenkins plugin.
          I'm trying to collect test results from a Jenkins build similarly how it is done in "logstash" plugin (which is Maven-based):
          https://github.com/jenkinsci/logstash-plugin

          I need to access hundson.tasks.test.AbstractTestResultAction class, which is now moved from Jenkins Core to Jenkins Junit plugin.

          the problem is that if I declare the dependency as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar'
          {code}

          , then my Gradle command-line build ("gradle jpi") works fine, but this class (and all classes from that library are not available in Jetbrains IDEA).
          and if I declare it as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6'
          {code}

          , then it becomes visible in IDEA, but command-line build starts to fail:

          {quote}
          /.../src/main/java/org/jenkinsci/plugins/jpp/BuildMessageBuilder.java:9: error: package hudson.tasks.test does not exist
          import hudson.tasks.test.AbstractTestResultAction;
                                  ^
          1 error
          {quote}
          New: I have a Gradle-based Jenkins plugin.
          I'm trying to collect test results from a Jenkins build similarly how it is done in "logstash" plugin (which is Maven-based):
          https://github.com/jenkinsci/logstash-plugin

          I need to access hundson.tasks.test.AbstractTestResultAction class, which is now moved from Jenkins Core to Jenkins Junit plugin.

          the problem is that if I declare the dependency as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar'
          {code}

          , then my Gradle command-line build ("gradle jpi") works fine, but this class (and all classes from that library are not available in Jetbrains IDEA).
          and if I declare it as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6'
          {code}

          , then it becomes visible in IDEA, but command-line build starts to fail:

          {quote}
          /.../src/main/java/org/jenkinsci/plugins/jpp/BuildMessageBuilder.java:9: error: package hudson.tasks.test does not exist
          import hudson.tasks.test.AbstractTestResultAction;
                                  ^
          1 error
          {quote}


          it may be a bug in IDEA rather than jpi plugin, of course. but maybe you have seen this before?..
          Alex Java made changes -
          Description Original: I have a Gradle-based Jenkins plugin.
          I'm trying to collect test results from a Jenkins build similarly how it is done in "logstash" plugin (which is Maven-based):
          https://github.com/jenkinsci/logstash-plugin

          I need to access hundson.tasks.test.AbstractTestResultAction class, which is now moved from Jenkins Core to Jenkins Junit plugin.

          the problem is that if I declare the dependency as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar'
          {code}

          , then my Gradle command-line build ("gradle jpi") works fine, but this class (and all classes from that library are not available in Jetbrains IDEA).
          and if I declare it as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6'
          {code}

          , then it becomes visible in IDEA, but command-line build starts to fail:

          {quote}
          /.../src/main/java/org/jenkinsci/plugins/jpp/BuildMessageBuilder.java:9: error: package hudson.tasks.test does not exist
          import hudson.tasks.test.AbstractTestResultAction;
                                  ^
          1 error
          {quote}


          it may be a bug in IDEA rather than jpi plugin, of course. but maybe you have seen this before?..
          New: I have a Gradle-based Jenkins plugin.
          I'm trying to collect test results from a Jenkins build similarly how it is done in "logstash" plugin (which is Maven-based):
          https://github.com/jenkinsci/logstash-plugin

          I need to access hundson.tasks.test.AbstractTestResultAction class, which is now moved from Jenkins Core to Jenkins Junit plugin.

          the problem is that if I declare the dependency as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar'
          {code}

          , then my Gradle command-line build ("gradle jpi") works fine, but this class (and all classes from that library are not available in Jetbrains IDEA).
          and if I declare it as

          {code}
                  jenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6'
          {code}

          , then it becomes visible in IDEA, but command-line build starts to fail:

          {quote}
          /.../src/main/java/org/jenkinsci/plugins/jpp/BuildMessageBuilder.java:9: error: package hudson.tasks.test does not exist
          import hudson.tasks.test.AbstractTestResultAction;
                                  ^
          1 error
          {quote}


          it may be a bug in IDEA rather than jpi plugin, of course. but maybe there is something that can be done in the plugin to simplify IDEA's dependency resolution?..
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Summary Original: classes from "junit" Jenkins plugin are not available in class path set by Gragle JPI Gradle plugin New: classes from "junit" Jenkins plugin are not available in class path in IDEA
          Alex Java made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 164200 ] New: JNJira + In-Review [ 208974 ]

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

              Created:
              Updated:
              Resolved: