Cannot run Gradle JAR task

Whenever I try to run gradle tests, gradle has to create jar files.
The issue with this is, that I have defined a custom output directory within my build.gradle:

    jar {
        archiveName = "CrystalShard-${}.jar"
        destinationDir = new File("${project.rootProject.projectDir.absolutePath}\\artifacts")


This is my build log:

Maybe someone of y’all is able to help me because I am lost for ideas, as I require this custom output directory.

I have right now created a workaround for this “bug”; as I have disabled the extra directory for every system that has the TRAVIS environment variable set

It does run and succeed like this, but this might be a bug within travis, im not sure about this.