2
我開始使用Gradle,我想知道如何在我的JAR中包含單個依賴項(TeamSpeak API),以便它可以在運行時使用。如何在包含Gradle的JAR中包含單個依賴項?
這裏是我的build.gradle的一部分:
apply plugin: 'java'
compileJava {
sourceCompatibility = '1.8'
options.encoding = 'UTF-8'
}
jar {
manifest {
attributes 'Class-Path': '.......'
}
from {
* What should I put here ? *
}
}
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core', version: '4.3.7.Final'
compile group: 'org.spigotmc', name: 'spigot', version: '1.8-R0.1-RELEASE'
// Many other dependencies, all available at runtime...
// This one isn't. So I need to include it into my JAR :
compile group: 'com.github.theholywaffle', name: 'teamspeak3-api', version: '+'
}
感謝您的幫助:)
依存關係不存儲在jar文件中。它們不在jar文件中,Class-Path清單條目包含該jar的相對路徑。 –