Looking at the doc of the gradle JPI plugin, it looks like dependencies should be declared differently than a "normal jar", with jenkinsPlugins, optionalJenkinsPlugins and jenkinsTest (see https://wiki.jenkins-ci.org/display/JENKINS/Gradle+JPI+Plugin section dependencies on other plugins).
Le jeu. 30 juin 2022 à 13:21, '[email protected]' via Jenkins Developers < [email protected]> a écrit : > answering myself > https://github.com/jenkinsci/job-dsl-plugin/blob/defect/org-folder-secrets/job-dsl-plugin/build.gradle#L113 > > > I am not sure I can help :( > > It may be because the hpl file is not created in your build setup > https://github.com/jenkinsci/jenkins-test-harness/blob/master/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L2108-L2116 > ? > > https://jenkinsci.github.io/maven-hpi-plugin/hpl-mojo.html > > other than that I do not know. > > /James > > > > On Thursday, June 30, 2022 at 12:10:16 PM UTC+1 [email protected] wrote: > >> Hi, >> >> > - could it be because I'm running on Gradle? >> >> :-) well you are in the minoroty and the least tested path. >> >> However I do not see any dependency for cloudbees-folder in >> https://github.com/jenkinsci/job-dsl-plugin/blob/defect/org-folder-secrets/build.gradle#L21-L27 >> (but I admit I am not a regular gradle user so may be missing something)? >> >> Where have you declared this dependency? >> >> /James >> >> On Wednesday, June 29, 2022 at 9:38:09 AM UTC+1 [email protected] wrote: >> >>> According to https://www.jenkins.io/doc/developer/testing/ : >>> >>> > Depending on Other Plugins >>> <https://www.jenkins.io/doc/developer/testing/#depending-on-other-plugins> >>> >>> > Any Jenkins plugins that you add as dependencies to your POM with >>> <scope>test</scope> will be available in the Jenkins installations >>> created while running test cases, or when using mvn hpi:run >>> <https://www.jenkins.io/doc/developer/tutorial/run/>. >>> >>> > You can also apply the @WithPlugin >>> <https://javadoc.jenkins.io/component/jenkins-test-harness/?org/jvnet/hudson/test/recipes/WithPlugin.html> >>> annotation to individual test cases, but this is rarely required. >>> However, when adding `testImplementation` and `testRuntimeOnly`, that >>> still doesn't work - could it be because I'm running on Gradle? >>> >>> On Wednesday, June 29, 2022 at 9:22:41 AM UTC+1 Jamie Tanna wrote: >>> >>>> When running the Jenkins Test Harness in tests via this branch >>>> <https://github.com/jenkinsci/job-dsl-plugin/tree/defect/org-folder-secrets>, >>>> I'm seeing the following error (bold for emphasis): >>>> >>>> 0.007 [id=1997] INFO >>>> o.jvnet.hudson.test.JenkinsRule#createWebServer: Running on >>>> http://localhost:42047/jenkins/ >>>> 0.027 [id=2012] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Started initialization >>>> 0.028 [id=2026] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Listed all plugins >>>> 0.077 [id=2016] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Prepared all plugins >>>> 0.078 [id=2028] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Started all plugins >>>> 0.165 [id=2037] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Augmented all extensions >>>> 0.171 [id=2021] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Loaded all jobs >>>> 0.175 [id=2027] INFO jenkins.InitReactorRunner$1#onAttained: >>>> Completed initialization >>>> 0.199 [seed #1] Legacy code started this job. No cause information >>>> is available >>>> 0.199 [seed #1] Running as SYSTEM >>>> 0.199 [seed #1] Building in workspace >>>> /tmp/jkh9605859418765359967/workspace/seed >>>> 0.199 [seed #1] Processing provided DSL script >>>> * 0.219 [seed #1] ERROR: (script, line 1) version 5.14 or later of >>>> plugin 'cloudbees-folder' needs to be installed* >>>> 0.220 [seed #1] Finished: FAILURE >>>> 0.221 [id=1997] INFO jenkins.model.Jenkins#cleanUp: Stopping >>>> Jenkins >>>> 0.230 [id=1997] INFO jenkins.model.Jenkins#cleanUp: Jenkins >>>> stopped >>>> >>>> How would I go about bootstrapping the plugin dependency for >>>> cloudbees-folder? It's down as an implementation dependency in the >>>> project, so I'd have assumed it'd work, but clearly not. >>>> >>>> Looks like potentially there's the `pluginManager.install` that I can >>>> use, is that the best bet? >>>> >>>> -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/2943a339-8f00-4ffe-a6e3-95e05861ca48n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/2943a339-8f00-4ffe-a6e3-95e05861ca48n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH6PkoJGN9nLLZU4xSpaE6d%3DoOfuC6TQyMYc86BHJCyPO1F6eQ%40mail.gmail.com.
