InstrumentCode error: error then resolving dependency "java-compoiler-ant-tasks" when complier plugin with gradle
已回答
Hello team:
I'm using gradle to build a custom plugin.But unfortunatly,I must develop it in company intranet.So I must use idea lib local Here is the build.gradle partly:
plugins{
id("java")
id("org.jetbrans.intellij") version "1.4.0"
}
repositorys{
maven{
url=uri("....")// a local nexus maven repository proxy the mavenCentral
}
maven{
url=uri("....")// a local nexus maven repository for 3rdparty
}
mavenCentral()
}
intellij{
localPath.set("C:\\Program Files\\JetBranis\\IntelliJ IDEA 2022.1")
}When I build plugin I got some errors when instrumentCode like:
Could not get resource "https://repo.maven.apache.org/maven2/com/jetbrans/intellij/java/java-gui-forms-rt/221.5080.210/java-gui-forms-rt-211.5080.210.pom"By download the jar and pom file then upload it to 3rdparty ,the problem can be solved.However, the number of missing JARs is very large, and I cannot upload each one. So is there any solution to solve this problem?
请先登录再写评论。
You're using an obsolete version of Gradle IntelliJ Plugin, please always update to the latest available one https://github.com/JetBrains/gradle-intellij-plugin/releases.
What exactly are the missing JARs reported?
When I change version to id("org.jetbrains.intellij") version “1.17.0” I got an error:
But in Project Sructure I set sdk is
jbr-17some build.gradle below:
JAR from here https://www.jetbrains.com/intellij-repository/releases
java-compiler-ant-tasks java-gui-forms-compiler java-gui-forms-rt java-compiler-instrumentation-util java-compiler-instrumentation-util-java8 .And jar from here https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/
ams-all-9.2 jdom-2.0.6I download them and upload them to the local repository for 3rdparty. Then the task instrumentCode run success ,But i got a new error in Task : runIde
Please make sure to configure Gradle to use the correct Java runtime https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#ide-configuration
I solved the problem by follow step:
1.download follow jar upload to 3rdparty repository:
https://www.jetbrains.com/intellij-repository/releases :
java-compiler-ant-tasks java-gui-forms-compiler java-gui-forms-rt java-compiler-instrumentation-util java-compiler-instrumentation-util-java8 uitl-jdomhttps://packages.jetbrains.team/maven/p/ij/intellij-dependencies/
ams-all-9.2 jdom-2.0.62.clear all gradle cache and chage gradle version from 7.4 to 8.4
3. Add local plugin proxy in
settings.gradle.kts:4. Set intellij version to 2022.2 IC:(Because in 2022.1 IC java version should be 11 )
See also:
https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#platformVersions
https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#ide-configuration