This is probably fallout from the Forbidden APIs upgrade. This is only failing on Windows. Looks like the reason is perhaps some funkiness in the file path normalization. The tool is outputing a file path with a `/` prefix and the assertion is expecting a relative path.

**Build scan:**
https://gradle-enterprise.elastic.co/s/iwrlmyjysvdpy/tests/:integTest/org.elasticsearch.gradle.internal.precommit.ThirdPartyAuditTaskFuncTest/reports%20violations%20and%20ignores%20compile%20only

**Reproduction line:**
```
null
```

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.gradle.internal.precommit.ThirdPartyAuditTaskFuncTest&tests.test=reports%20violations%20and%20ignores%20compile%20only

**Failure excerpt:**
```
org.spockframework.runtime.ConditionNotSatisfiedError: Condition not satisfied:

normalized(givenOutput).contains(normalized(expected))
|          |            |        |          |
|          |            false    |          Forbidden APIs output:
|          |                     |          DEBUG: Classpath: [file:./build/precommit/thirdPartyAudit/thirdPartyAudit/]
|          |                     |          DEBUG: Detected Java 9 or later with module system.
|          |                     |          ERROR: Forbidden class/interface use: java.io.File [non-public internal runtime class]
|          |                     |          ERROR:   in org.acme.TestingIO (method declaration of 'getFile()')
|          |                     |          ERROR: Scanned 1 class file(s) for forbidden API invocations (in 0.00s), 1 error(s).
|          |                     |          ERROR: Check for forbidden API calls failed, see log.
|          |                     |          ==end of forbidden APIs==
|          |                     |          Classes with violations:
|          |                     |            * org.acme.TestingIO
|          |                     Forbidden APIs output:
|          |                     DEBUG: Classpath: [file:./build/precommit/thirdPartyAudit/thirdPartyAudit/]
|          |                     DEBUG: Detected Java 9 or later with module system.
|          |                     ERROR: Forbidden class/interface use: java.io.File [non-public internal runtime class]
|          |                     ERROR:   in org.acme.TestingIO (method declaration of 'getFile()')
|          |                     ERROR: Scanned 1 class file(s) for forbidden API invocations (in 0.00s), 1 error(s).
|          |                     ERROR: Check for forbidden API calls failed, see log.
|          |                     ==end of forbidden APIs==
|          |                     Classes with violations:
|          |                       * org.acme.TestingIO
|          Encryption of the configuration cache is enabled.
|          Calculating task graph as no configuration cache is available for tasks: :thirdPartyAudit
|          =======================================
|          Elasticsearch Build Hamster says Hello!
|            Gradle Version        : 8.1.1
|            OS Info               : Windows Server 2012 R2 6.3 (amd64)
|            JDK Version           : 17.0.2+8-86 (Oracle)
|            JAVA_HOME             : C:/Users/jenkins/.java/openjdk17
|            Random Testing Seed   : 101AD76F54E76DD6
|            In FIPS 140 mode      : false
|          =======================================
|          > Task :thirdPartyAuditResources
|           
|          > Task :thirdPartyAudit FAILED
|          Forbidden APIs output:
|          DEBUG: Classpath: [file:/./build/precommit/thirdPartyAudit/thirdPartyAudit/]
|          DEBUG: Detected Java 9 or later with module system.
|          ERROR: Forbidden class/interface use: java.io.File [non-public internal runtime class]
|          ERROR:   in org.acme.TestingIO (method declaration of 'getFile()')
|          ERROR: Scanned 1 class file(s) for forbidden API invocations (in 0.00s), 1 error(s).
|          ERROR: Check for forbidden API calls failed, see log.
|          ==end of forbidden APIs==
|          Classes with violations:
|            * org.acme.TestingIO
|           
|          0 problems were found storing the configuration cache.
|           
|          See the complete report at file:///./build/reports/configuration-cache/2vznkekf0cy6s22bzerw46rc7/cn473lmturooeqioptkv4m91q/configuration-cache-report.html
|           
|          FAILURE: Build failed with an exception.
|           
|          * What went wrong:
|          Execution failed for task ':thirdPartyAudit'.
|          > Audit of third party dependencies failed
|           
|          * Try:
|          > Run with --stacktrace option to get the stack trace.
|          > Run with --info or --debug option to get more log output.
|          > Run with --scan to get full insights.
|           
|          * Get more help at https://help.gradle.org
|           
|          BUILD FAILED in 3s
|          2 actionable tasks: 2 executed
|          Configuration cache entry stored.
Encryption of the configuration cache is enabled.
Calculating task graph as no configuration cache is available for tasks: :thirdPartyAudit
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Windows Server 2012 R2 6.3 (amd64)
  JDK Version           : 17.0.2+8-86 (Oracle)
  JAVA_HOME             : C:/Users/jenkins/.java/openjdk17
  Random Testing Seed   : 101AD76F54E76DD6
  In FIPS 140 mode      : false
=======================================
> Task :thirdPartyAuditResources
 
> Task :thirdPartyAudit FAILED
Forbidden APIs output:
DEBUG: Classpath: [file:/./build/precommit/thirdPartyAudit/thirdPartyAudit/]
DEBUG: Detected Java 9 or later with module system.
ERROR: Forbidden class/interface use: java.io.File [non-public internal runtime class]
ERROR:   in org.acme.TestingIO (method declaration of 'getFile()')
ERROR: Scanned 1 class file(s) for forbidden API invocations (in 0.00s), 1 error(s).
ERROR: Check for forbidden API calls failed, see log.
==end of forbidden APIs==
Classes with violations:
  * org.acme.TestingIO
 
0 problems were found storing the configuration cache.
 
See the complete report at file:///./build/reports/configuration-cache/2vznkekf0cy6s22bzerw46rc7/cn473lmturooeqioptkv4m91q/configuration-cache-report.html
 
FAILURE: Build failed with an exception.
 
* What went wrong:
Execution failed for task ':thirdPartyAudit'.
> Audit of third party dependencies failed
 
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
 
* Get more help at https://help.gradle.org
 
BUILD FAILED in 3s
2 actionable tasks: 2 executed
Configuration cache entry stored.

  at org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest.assertOutputContains(AbstractGradleFuncTest.groovy:96)
  at org.elasticsearch.gradle.internal.precommit.ThirdPartyAuditTaskFuncTest.reports violations and ignores compile only(ThirdPartyAuditTaskFuncTest.groovy:109)

```
build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.gradle.internal.test;
import java.io.File;
import java.io.IOException;
import java.util.stream.Collectors;
public class TestUtils {
    public static String normalizeString(String input, File projectRootDir) {
        try {
            String cannonicalNormalizedPathPrefix = projectRootDir.getCanonicalPath().replace("\\", "/");
            String normalizedPathPrefix = projectRootDir.getAbsolutePath().replace("\\", "/");
            return input.lines()
                .filter(it -> it.startsWith("Picked up JAVA_TOOL_OPTIONS") == false)
                .map(it -> it.replace("\\", "/"))
                .map(it -> it.replaceAll("\\d+\\.\\d\\ds", "0.00s"))
                .map(it -> it.replaceAll(cannonicalNormalizedPathPrefix, "."))
                .map(it -> it.replaceAll(normalizedPathPrefix, "."))
                .map(it -> it.replaceAll("Gradle Test Executor \\d", "Gradle Test Executor 1"))
                .collect(Collectors.joining("\n"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}