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

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

XMLWordPrintable

    • 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?..

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

              Created:
              Updated:
              Resolved: