I am building a bot in Intellij using Gradle. I've completed the bot and try to execute the jar task in build a .jar to with all the dependancies. However, I keep running into an error.
Cannot convert the provided notation to a File or URI: [ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\net.dv8tion\JDA\4.3.0_282\c2e3739477a8e59699355db3bae73b3ab0a1c62e\JDA-4.3.0_282.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\me.duncte123\botCommons\1.0.73\bdadec013dad0b8dc6c582ddc080677978d7adcd\botCommons-1.0.73.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\com.sedmelluq\lavaplayer\1.3.64\69e1889fc5db48dafd1a22f76721d3d95a5b06be\lavaplayer-1.3.64.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\io.github.cdimascio\java-dotenv\5.1.1\6c5712d04751e707b9f925aab756302e74103f59\java-dotenv-5.1.1.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\mysql\mysql-connector-java\5.1.6\380ef5226de2c85ff3b38cbfefeea881c5fce09d\mysql-connector-java-5.1.6.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\net.sf.trove4j\trove4j\3.0.3\42ccaf4761f0dfdfa805c9e340d99a755907e2dd\trove4j-3.0.3.jar', ZIP 'C:\Users\name.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.10.1\18eee15ffc662d27538d5b6ee84e4c92c0a9d03e\jackson-databind-2.10.1.jar', ...]. The following types/formats are supported: - A String or CharSequence path, for example 'src/main/java' or '/usr/include'. - A String or CharSequence URI, for example 'file:/usr/include'. - A File instance. - A Path instance. - A Directory instance. - A RegularFile instance. - A URI or URL instance. - A TextResource instance.
(The list of ZIPs was cut short due to there being way too many to list out.)
Below is what my build.gradle file looks like when I try to run.
plugins {
id 'java'
id 'application'
}
group 'com.darkascendants'
version '1.0-SNAPSHOT'
application {
mainClassName = 'com.darkascendants.DABot'
}
repositories {
mavenCentral()
jcenter()
maven {
name 'm2-dv8tion'
url 'https://m2.dv8tion.net/releases'
}
}
apply plugin: 'java'
dependencies {
implementation group: 'net.dv8tion', name: 'JDA', version: '4.3.0_282'
implementation group: 'me.duncte123', name: 'botCommons', version: '1.0.73'
implementation group: 'com.jagrosh', name: 'jda-utilities', version: '3.0.1'
implementation group: 'com.sedmelluq', name: 'lavaplayer', version: '1.3.64'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
implementation group: 'io.github.cdimascio', name: 'java-dotenv', version: '5.1.1'
implementation group: 'mysql', name: 'mysql-connector-java', version: '5.1.6'
implementation fileTree('libs') { include '*.jar' }
}
compileJava.options.encoding = 'UTF-8'
jar {
manifest {
attributes(
'Main-Class': 'com.darkascendants.DABot'
)
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
}
Why am I running into this issue?