Gradle Plugin Test fails because the plugin can't be found

plugins

(Alex Earl) #1

I am completely new to Gradle. I am writing a plugin for Jenkins plugin hosting (to test that a plugin meets minimum hosting requirements). I copied the setup from a plugin that was previously developed for Jenkins to use gradle to build plugins. The original plugin is able to run tests that use GradleRunner, however, if I try to run a test with GradleRunner in my plugin, I am getting an error that says my plugin can’t be found. I’m not sure where to proceed from here, I’ve seen a few posts on the forums that had similar errors, but I the fixes or workarounds don’t seem to work for me.

I would appreciate any direction you might have (not looking for handouts, just some direction on where to go from here).

My source is at https://github.com/slide/gradle-hosting-checker-plugin.

The full error is below:

org.gradle.testkit.runner.UnexpectedBuildFailure: Unexpected build execution failure in C:\Users\USER\AppData\Local\Temp\junit8603699388561458217 with arguments [hostingCheck, --stacktrace]

Output:

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\USER\AppData\Local\Temp\junit4645260520250523254\build.gradle’ line: 2

  • What went wrong:
    Plugin [id: ‘org.jenkins-ci.hosting-checker’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Gradle TestKit (classpath: C:\Users\USER\Code\hosting\gradle-hosting-checker-plugin\build\classes\main;C:\Users\USER\Code\hosting\gradle-hosting-checker-plugin\build\resources\main;C:\Users\USER.m2\repository\org\jenkins-ci\jpi\0.21.0-SNAPSHOT\jpi-0.21.0-SNAPSHOT.jar;C:\Users\USER.m2\repository\org\jvnet\localizer\maven-localizer-plugin\1.23\maven-localizer-plugin-1.23.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.jenkins-ci\version-number\1.1\19aaa284b3abaeb64c226bf6b5cb25b8ddf7379e\version-number-1.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\net.java.sezpoz\sezpoz\1.12\1f7e4a04e06fdbc91d66ddf80c443c3f7c6503c\sezpoz-1.12.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-plugin-api\2.0.1\fa8134698dbb25d95db444b772504020cfcee10c\maven-plugin-api-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-archiver\2.0.1\b7addcbb2ce96cdc92f1991d3e5da0b2c59b8b0\maven-archiver-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\2.0.1\f5a934abbbc70a33136d89a996b9d5c09f652766\maven-artifact-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.ant\ant\1.7.0\9746af1a485e50cf18dcb232489032a847067066\ant-1.7.0.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\com.sun.codemodel\codemodel\2.6\cde4647fcebedb3663bccc79e21789e8e6755a19\codemodel-2.6.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.1\905075e6c80f206bbe6cf1e809d2caa69f420c76\commons-lang3-3.1.jar;C:\Users\USER.m2\repository\org\jvnet\localizer\localizer\1.23\localizer-1.23.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-project\2.0.1\2257389127929013ae5eca710bf0985c197bc0f8\maven-project-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-archiver\1.0-alpha-4\cb8f55d2f8766ed9c1c8abe538196a9a9d7bc411\plexus-archiver-1.0-alpha-4.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.ant\ant-launcher\1.7.0\e7e30789211e074aa70ef3eaea59bd5b22a7fa7a\ant-launcher-1.7.0.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-profile\2.0.1\8f49ed40eb680a34da6254783a92f215e13b8cf4\maven-profile-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-model\2.0.1\9a01ccc49d50211fe70f453cf312bd6116d9fa39\maven-model-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact-manager\2.0.1\c7c611e5db7b48af79bbcbdeda1bbd4baff1e8ee\maven-artifact-manager-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-container-default\1.0-alpha-9\50596183cd7b688d9d7b6d868a0193ca1a8a7b3d\plexus-container-default-1.0-alpha-9.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-repository-metadata\2.0.1\f860cbcbe9a5adb4857ebd05f3eaf82e5d0ac6dd\maven-repository-metadata-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven.wagon\wagon-provider-api\1.0-alpha-5\30d03be3128389dae0419701b1cb4b3034e1cabc\wagon-provider-api-1.0-alpha-5.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-utils\1.0.5\aac8547f762cffe58fd3e0378651a489b8b3798a\plexus-utils-1.0.5.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\classworlds\classworlds\1.1-alpha-2\5adf2e681c57d7f48038b602f3ca2254ee82d47\classworlds-1.1-alpha-2.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\junit\junit\3.8.1\99129f16442844f6a4a11ae22fbbee40b14d774f\junit-3.8.1.jar)
  • Gradle Central Plugin Repository (plugin dependency must include a version number for this source)
  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘org.jenkins-ci.hosting-checker’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Gradle TestKit (classpath: C:\Users\USER\Code\hosting\gradle-hosting-checker-plugin\build\classes\main;C:\Users\USER\Code\hosting\gradle-hosting-checker-plugin\build\resources\main;C:\Users\USER.m2\repository\org\jenkins-ci\jpi\0.21.0-SNAPSHOT\jpi-0.21.0-SNAPSHOT.jar;C:\Users\USER.m2\repository\org\jvnet\localizer\maven-localizer-plugin\1.23\maven-localizer-plugin-1.23.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.jenkins-ci\version-number\1.1\19aaa284b3abaeb64c226bf6b5cb25b8ddf7379e\version-number-1.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\net.java.sezpoz\sezpoz\1.12\1f7e4a04e06fdbc91d66ddf80c443c3f7c6503c\sezpoz-1.12.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-plugin-api\2.0.1\fa8134698dbb25d95db444b772504020cfcee10c\maven-plugin-api-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-archiver\2.0.1\b7addcbb2ce96cdc92f1991d3e5da0b2c59b8b0\maven-archiver-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\2.0.1\f5a934abbbc70a33136d89a996b9d5c09f652766\maven-artifact-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.ant\ant\1.7.0\9746af1a485e50cf18dcb232489032a847067066\ant-1.7.0.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\com.sun.codemodel\codemodel\2.6\cde4647fcebedb3663bccc79e21789e8e6755a19\codemodel-2.6.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.1\905075e6c80f206bbe6cf1e809d2caa69f420c76\commons-lang3-3.1.jar;C:\Users\USER.m2\repository\org\jvnet\localizer\localizer\1.23\localizer-1.23.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-project\2.0.1\2257389127929013ae5eca710bf0985c197bc0f8\maven-project-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-archiver\1.0-alpha-4\cb8f55d2f8766ed9c1c8abe538196a9a9d7bc411\plexus-archiver-1.0-alpha-4.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.ant\ant-launcher\1.7.0\e7e30789211e074aa70ef3eaea59bd5b22a7fa7a\ant-launcher-1.7.0.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-profile\2.0.1\8f49ed40eb680a34da6254783a92f215e13b8cf4\maven-profile-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-model\2.0.1\9a01ccc49d50211fe70f453cf312bd6116d9fa39\maven-model-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact-manager\2.0.1\c7c611e5db7b48af79bbcbdeda1bbd4baff1e8ee\maven-artifact-manager-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-container-default\1.0-alpha-9\50596183cd7b688d9d7b6d868a0193ca1a8a7b3d\plexus-container-default-1.0-alpha-9.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-repository-metadata\2.0.1\f860cbcbe9a5adb4857ebd05f3eaf82e5d0ac6dd\maven-repository-metadata-2.0.1.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.apache.maven.wagon\wagon-provider-api\1.0-alpha-5\30d03be3128389dae0419701b1cb4b3034e1cabc\wagon-provider-api-1.0-alpha-5.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\org.codehaus.plexus\plexus-utils\1.0.5\aac8547f762cffe58fd3e0378651a489b8b3798a\plexus-utils-1.0.5.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\classworlds\classworlds\1.1-alpha-2\5adf2e681c57d7f48038b602f3ca2254ee82d47\classworlds-1.1-alpha-2.jar;C:\Users\USER.gradle\caches\modules-2\files-2.1\junit\junit\3.8.1\99129f16442844f6a4a11ae22fbbee40b14d774f\junit-3.8.1.jar)
  • Gradle Central Plugin Repository (plugin dependency must include a version number for this source)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:197)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$000(DefaultPluginRequestApplicator.java:44)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:67)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:65)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:188)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:183)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:65)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:140)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:529)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
    at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)

BUILD FAILED

Total time: 4.817 secs

at org.gradle.testkit.runner.internal.DefaultGradleRunner$1.execute(DefaultGradleRunner.java:222)
at org.gradle.testkit.runner.internal.DefaultGradleRunner$1.execute(DefaultGradleRunner.java:219)
at org.gradle.testkit.runner.internal.DefaultGradleRunner.run(DefaultGradleRunner.java:282)
at org.gradle.testkit.runner.internal.DefaultGradleRunner.build(DefaultGradleRunner.java:219)
at org.jenkinsci.gradle.plugins.hosting.TestHostingCheckerTaskSpec.basic information check(TestHostingCheckerTaskSpec.groovy:18)

(Benjamin Muschko) #2

It doesn’t look like you are declaring a properties file that maps the plugin ID org.jenkins-ci.hosting-checker to the plugin implementation. You have to be explicit about it.


(Alex Earl) #3

Thank you so much! That was it! I appreciate your help very much. I missed that directory when I was looking at the plugin I was starting from,