IDEA插件开发系列1-环境的准备

51 阅读1分钟

1.插件开发环境的准备

我使用的是当时最新版本的idea,版本信息如下 image.png

  1. 新建gradle工程

    • 1.1 注意JDK要选择11版本以上的
    • 1.2 DSL可选择groovy或者Kotlin,两者语法相似 image.png
    • 1.3 新建后的工程包含build.gradle.kts文件,org.jetbrains.intellij是开发idea插件必备的一个依赖.新版idea会自动生成.
       plugins {
           id("java")
           id("org.jetbrains.intellij") version "1.10.1"
       }
    
    • 1.4 如果新建工程运行gradle后报如下错误,原因是JDK版本过低.解决方案: 参考 即如何修改gradle项目的JDK版本.
        FAILURE: Build failed with an exception.
    
        * What went wrong:
        A problem occurred configuring root project 'string-template-error-scanner'.
        > Could not resolve all artifacts for configuration ':classpath'.
           > Could not resolve org.jetbrains.intellij.plugins:gradle-intellij-plugin
    

    image.png