0

I have a small java project to create Jenkins plugins, the dependency management and build tool is Gradle version 7.
In the 'buildscript' section I import some dependencies stored in our artifactory dependencies repository

 buildscript {
  repositories {
    maven {
      url 'http://artifactory.MY.DOMAIN.com/gradle-plugins/'
      allowInsecureProtocol = true
    }
    maven {
      url 'https://plugins.gradle.org/m2/'
    }
  }
}

When the compileJava sub task runs, i get compile time errors, they all refer to missing packages which reside in the remote artifact repository, for example, from the code in one of the classes I import package jenkins.branch.BranchProjectFactory, but at compile time I get:

15:21:40  /home/jenkins/agent/workspace/INTERNAL-LONG-PACKAGE-NAME/JenkinsfileRetriever.java:5: error: package jenkins.branch does not exist
15:21:40  import jenkins.branch.BranchProjectFactory;

The error message is very clear, and from this issue i understand that the package i try to import is actually not in the classpath, but i am trying to understand why Gradle does not add that into the classpath...in artifactory i do see the dependencies i look for, but apparently they are not resolved, but if that is true, wouldn't the task resolveDependencies fail?

Any thoughts?

JBoy
  • 5,175
  • 12
  • 58
  • 94

0 Answers0