Hmm, I don’t get any warnings in the test case. Is there an option to enable
some more logging for the Jenkins startup when the test rule is starting?
What is also strange: the test fails when running in the IDE with Java 21 as
well (when the project has been built with Java 25 on the command line).
I tried with a very simple test:
@WithJenkins
public class Java25ITest {
private JenkinsRule jenkins;
@BeforeEach
public void setUp(final JenkinsRule jenkins) {
this.jenkins = jenkins;
}
@Test
void shouldOverwriteReferenceBuild() throws Exception {
var reference = jenkins.createProject(WorkflowJob.class);
reference.setDefinition(new CpsFlowDefinition(
"""
node {
echo 'Hello Job';
discoverReferenceBuild();
}
""", true));
jenkins.buildAndAssertSuccess(reference);
}
}
The logger does not print anything interesting:
0.041 [id=1] INFO o.jvnet.hudson.test.WarExploder#explode: Picking up
existing exploded jenkins.war at
/Users/hafner/git/warnings-ng-plugin-devenv/forensics-api/target/jenkins-for-test
0.223 [id=1] INFO o.jvnet.hudson.test.JenkinsRule#createWebServer2:
Running on http://localhost:55255/jenkins/
0.279 [id=1] INFO jenkins.model.Jenkins#<init>: Starting version 2.516.3
0.329 [id=50] INFO jenkins.InitReactorRunner$1#onAttained: Started
initialization
1.080 [id=65] INFO jenkins.InitReactorRunner$1#onAttained: Listed
all plugins
1.091 [id=49] INFO j.b.api.BouncyCastlePlugin#start:
/Users/hafner/git/warnings-ng-plugin-devenv/forensics-api/target/tmp/j
h12347251479471561382/plugins/bouncycastle-api/WEB-INF/optional-lib not found;
for non RealJenkinsRule this is fine and can be ignored.
1.717 [id=62] INFO jenkins.InitReactorRunner$1#onAttained:
Prepared all plugins
1.721 [id=67] INFO jenkins.InitReactorRunner$1#onAttained: Started
all plugins
1.721 [id=69] INFO jenkins.InitReactorRunner$1#onAttained:
Augmented all extensions
2.243 [id=69] INFO jenkins.InitReactorRunner$1#onAttained: System
config loaded
2.244 [id=48] INFO jenkins.InitReactorRunner$1#onAttained: System
config adapted
2.244 [id=48] INFO jenkins.InitReactorRunner$1#onAttained: Loaded
all jobs
2.247 [id=48] INFO jenkins.InitReactorRunner$1#onAttained:
Configuration for all jobs updated
2.262 [id=51] INFO jenkins.InitReactorRunner$1#onAttained:
Completed initialization
2.992 [id=1] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping
Jenkins
3.027 [id=1] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins
stopped
3.046 [id=1] INFO o.j.h.t.TemporaryDirectoryAllocator#dispose: deleting
/Users/hafner/git/warnings-ng-plugin-devenv/forensics-api/target/tmp/j
h12347251479471561382
java.lang.AssertionError: unexpected build status; build log was:
------
Started
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in
/Users/hafner/git/warnings-ng-plugin-devenv/forensics-api/target/tmp/j
h12347251479471561382/workspace/test0
[Pipeline] {
[Pipeline] echo
Hello Job
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId:
d82886aa-8ae5-4d59-b445-7519a5fe5e0a
java.lang.NoSuchMethodError: No such DSL method 'discoverReferenceBuild' found
among steps [archive, bat,
[1] https://github.com/jenkinsci/forensics-api-plugin/pull/628
[2]
https://github.com/jenkinsci/forensics-api-plugin/actions/runs/18064790164/job/51406118747?pr=628
> Am 23.09.2025 um 20:58 schrieb 'Jesse Glick' via Jenkins Developers
> <[email protected]>:
>
> On Tue, Sep 23, 2025 at 11:45 AM Ullrich Hafner <[email protected]
> <mailto:[email protected]>> wrote:
>> my pipeline steps are not found when I build with Java 25:
>>
>> java.lang.NoSuchMethodError: No such DSL method 'discoverReferenceBuild'
>> found among steps [archive, ..., zip] or globals [currentBuild, env, params,
>> pipeline, scm]
>> at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:219)
>
> Curious; `workflow-cps-plugin` tests pass for me on Java 25 (albeit with
> warnings about JNA and XStream).
>
> --
> 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]
> <mailto:[email protected]>.
> To view this discussion visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3g5tnCb%2BbO1%2BoeiMcBqQjZpkR8HobJPgZpnnyDKNAWdQ%40mail.gmail.com
>
> <https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3g5tnCb%2BbO1%2BoeiMcBqQjZpkR8HobJPgZpnnyDKNAWdQ%40mail.gmail.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 visit
https://groups.google.com/d/msgid/jenkinsci-dev/AFFF8A61-C8D6-4D25-9FED-CE53DAE16C46%40gmail.com.