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的相对路径。 –