InstrumentCode error: error then resolving dependency "java-compoiler-ant-tasks" when complier plugin with gradle

Answered

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?

0
4 comments

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?

1

    When I change version to id("org.jetbrains.intellij") version “1.17.0” I got an error: 

unsupported class file major version 63. 
Failed to create Jar file C:\Users\localUser\.gradle\caches\jars-9\b434e5cc9816519e3d9b77db3c65f31a\jackson-core-2.16.0.jar

But in Project Sructure I set sdk is jbr-17

some build.gradle below:

tasks{
	withType<JavaComplile>{
		sourceCompatibility = "17"
		targetCompatibility = "17"
	}
	
	patchPluginXml{
		sinceBuild.set("221")
		untilBuild.set("233.*")
	}
}

 

 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.6

I  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 

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "com.intellij.util.lang.PathClassLoader"). To use archived non-system classes, this property must not be set

Process 'command' 'C:\Users\localUser\.jdks\jbr-17.0.9\bin\java.exe' finished with non-zero exit value 1
0

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-jdom

https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/

ams-all-9.2 jdom-2.0.6

2.clear all gradle cache and chage gradle version from 7.4 to 8.4

3. Add local plugin proxy in settings.gradle.kts:

pluginManagement{
	repositories{
		maven{
			url=uri(....)//a gradle repository proxy the https://plugins.gradle.org/ by nexus
		}
	}
}

4. Set intellij version to 2022.2 IC:(Because in 2022.1 IC java version should be 11  )

intellij{
	localPath.set("C:\\Program Files\\JetBranis\\IntelliJ IDEA 2022.1")
}
tasks{
	withType<JavaComplile>{
		sourceCompatibility = "17"
		targetCompatibility = "17"
	}
	
	patchPluginXml{
		sinceBuild.set("222")
		untilBuild.set("233.*")
	}
}

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

0

Please sign in to leave a comment.