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

Build fails for empty project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • gradle-jpi-plugin
    • None
    • - gradle-jpi-plugin 0.22.0
      - gradle 3.3
      - windows 7

      I've got the following build.gradle:

      plugins {
          id 'org.jenkins-ci.jpi' version '0.22.0'
      }
      
      group = 'my.jenkins.plugin'
      version = "1.0"
      
      jenkinsPlugin {
          shortName = 'my-plugin'
          displayName = 'My Jenkins Plugin'
      
          coreVersion = '2.32.2'
          disabledTestInjection = false
      
          localizerOutputDir = "$buildDir/generated-src/localizer"
      }
      

      There are no sources yet (but it does not make any difference if i create some java-files). When i run gradle build on the command-line, the build fails with failing tests in

      InjectedTest > org.jvnet.hudson.test.junit.FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite FAILED
          org.jvnet.hudson.reactor.ReactorException
              Caused by: java.lang.Error
      

      The test-result contains the following stack-trace:

      org.jvnet.hudson.reactor.ReactorException: java.lang.Error: Unable to find <path-to-project>\build\jenkins-for-test\WEB-INF\plugins
      	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
      	at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
      	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1109)
      	at jenkins.model.Jenkins.<init>(Jenkins.java:925)
      	at hudson.model.Hudson.<init>(Hudson.java:85)
      	at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:487)
      	at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:318)
      	at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.setUp(JellyTestSuiteBuilder.java:143)
      	at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:49)
      	at junit.framework.TestSuite.runTest(TestSuite.java:243)
      	at junit.framework.TestSuite.run(TestSuite.java:238)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
      	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
      	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
      	at com.sun.proxy.$Proxy3.processTestClass(Unknown Source)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
      	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
      	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.Error: Unable to find <path-to-project>\build\jenkins-for-test\WEB-INF\plugins
      	at org.jvnet.hudson.test.TestPluginManager.loadBundledPlugins(TestPluginManager.java:70)
      	at hudson.PluginManager$1$1.run(PluginManager.java:379)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
      	at jenkins.model.Jenkins$7.runTask(Jenkins.java:1085)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      	... 3 more
      

      The test has it right: there is no directory called "plugins" in WEB-INF, only "detached-plugins".
      I've tried to add some files below src/main/java and src/test/java and added some dependencies to other plugins but to no avail. Java classes and Test-Classes get compiled and the tests executed but the directory "plugins" is not created.

      gradle jpi and gradle serve both work...

            sghill Steve Hill
            argelbargel Karsten Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: