这是我第一次做gradle,不是从头开始的,我在这里用这个代码作为我的源代码,它是用gradle构建的;https://github.com/kaaz/discordbot
几天前,当我尝试用intellij构建gradle时,它运行得非常好。然后,我将它保留了几天,没有对代码或intellij设置本身进行任何更新或编辑。但是,今天我第一次打开它,突然这个通知导致构建失败 java.lang.NoClassDefFoundError: org/gradle/api/internal/plugins/DefaultConvention
它让我把androidsdk放到我的intellij上。我试着在网上查,结果大多发生在他们做android项目的时候。同时,我正在做的是一个不和谐的机器人项目-所以,我不确定把android sdk放到我的intellij中是否是最好的方法。
这就是我所拥有的
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
}
}
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'com.nijibase.main.Launcher'
// needed to prevent inclusion of gradle-api into shadow JAR
configurations.compile.dependencies.remove dependencies.gradleApi()
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'com.github.Kaaz'
version = '1.9.17'
description = "nijibase discord bot"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
processResources {
filesMatching('**project.properties') {
filter ReplaceTokens, tokens: [
'version': version
]
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/bots4j/maven-repo" }
maven { url "https://jcenter.bintray.com" }
maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.apache.ant', name: 'ant', version: '1.7.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
compile group: 'org.json', name: 'json', version: '20170516'
compile group: 'com.github.rithms', name: 'riot-api-java', version: '4.0.1'
compile group: 'org.jsoup', name: 'jsoup', version: '1.10.3'
compile group: 'org.graylog2', name: 'gelfclient', version: '1.4.0'
compile group: 'org.knowm.xchart', name: 'xchart', version: '3.2.1'
compile group: 'com.google.apis', name: 'google-api-services-youtube', version: 'v3-rev192-1.23.0'
compile group: 'com.kcthota', name: 'emoji4j', version: '5.0'
compile group: 'net.dv8tion', name: 'JDA', version: '3.8.1_457'
compile group: 'com.sedmelluq', name: 'lavaplayer', version: '1.3.49'
compile group: 'org.reflections', name: 'reflections', version: '0.9.10'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.40'
compile group: 'com.github.Kaaz', name: 'trello4j', version: 'master-SNAPSHOT'
compile group: 'com.github.Kaaz', name: 'ConfigurationBuilder', version: '0c4957579e'
compile group: 'com.github.Kaaz', name: 'lib-poe', version: '1.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.3'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.6'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.8.2'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.3'
compile group: 'org.bots4j', name: 'wit-ai-client', version: '0.01'
}
我的gradle版本是6.7.1
而我的java版本是1.8.0ď
暂无答案!
目前还没有任何答案,快来回答吧!