gpt4 book ai didi

java - 使用 Gradle 的 IntelliJ 插件提供 java.lang.NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-03 05:41:06 26 4
gpt4 key购买 nike

我正在尝试使用共享模块的 vanilla IntelliJ 插件。

插件构建似乎找到了我的src目录,但不包括我的共享模块的类。如何告诉 gradle 在构建的插件中包含我的共享库类?

我尝试添加编译依赖项,但在 IDE 中运行时没有 java.lang.NoClassDefFoundError。

Gradle 构建文件:

plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.3.12'
}

group 'com.prosc'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile files('out/production/MySharedLibrary')
}

intellij {
version '2018.2.3'
}

最佳答案

org.jetbrains.intellij 的文档pluginName 的提示:

intellij {
version 'IC-2018.2.3'
plugins = ['coverage', 'org.intellij.plugins.markdown:8.5.0.20160208']
pluginName 'MySharedLibrary'
}
build.gradle.kts类似:
val sdkVersion = System.getProperty("idea.version", "IC-2018.2.3")
val pluginName = "MySharedLibrary"

configure<IntelliJPluginExtension> {
version = sdkVersion
pluginName = pluginName
setPlugins(
"android",
"CheckStyle-IDEA:5.3.1",
"copyright",
"CSS",
"gradle",
"Groovy",
"JavaScriptLanguage",
"junit",
"properties",
"uml"
)
}

关于java - 使用 Gradle 的 IntelliJ 插件提供 java.lang.NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52980109/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com