A problem occurred evaluating root project 'kel-intellij-plugin'. > Could not find method defaultRepositories() for arguments [] on extension 'intellijPlatform' of type org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension.

Answered

Error is :
A problem occurred evaluating root project 'test-intellij-plugin'. > Could not find method defaultRepositories() for arguments [] on extension 'intellijPlatform' of type org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension. 
If I delete defaultRepositories() not able to load intellij platform dependencies.

My Build.gradle file is 

plugins {
   id 'java'
   id 'org.jetbrains.intellij.platform' version '2.2.1'
   id 'org.jetbrains.intellij.platform.migration' version "2.2.1"
}

group 'Test'
version = 1.1.0

def user = "test;
def password = "test";

allprojects {
   repositories {

       maven{
           url "https://www.jetbrains.com/intellij-repository/releases"
       }
       intellijPlatform{
           defaultRepositories()
       }
       maven {
           url "target/dependencies"
       }
       mavenLocal()
       maven {
           credentials {
               user user
               password password
           }
           url "https://company-frog"
       }
     
       mavenCentral()

   }
   apply plugin: 'java'
   apply plugin: 'org.jetbrains.intellij.platform'

   dependencies {
       testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "$junit5Version"
       testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "$junit5Version"
   }

   compileJava {
       sourceCompatibility = javaVersion
       targetCompatibility = javaVersion
   }

   sourceSets {
       main {
           java.srcDirs 'src'
           resources.srcDirs 'resources'
       }
   }
   buildSearchableOptions.enabled = false
   def compilationPackages = ['test/com/test1/intellij/jps/plugin/**']
}

apply plugin: 'antlr'

wrapper {
   gradleVersion = gradleBuildVersion
}

dependencies{

   intellijPlatform{
       intellijIdeaCommunity '2024.3.2'
       bundledPlugin 'com.intellij.java'
       bundledPlugin 'org.jetbrains.idea.maven'
       plugin 'org.intellij.scala', '2024.1.4'
   }
   
   implementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "$junit5Version"
   implementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "$junit5Version"
   implementation group: 'org.mockito', name: 'mockito-core', version: "$mockitoCoreVersion"
   implementation group: 'org.mockito', name: 'mockito-inline', version: "$mockitoInlineVersion"
}
intellijPlatform {
   pluginConfiguration{
       ideaVersion {
           sinceBuild = '233'
           untilBuild = '250.*'
       }
       patchPluginXml {
           doLast {
               pluginXmlFiles.get().each {
                   def updatedFile = new File(destinationDir.get().asFile, it.name)
                   ant.replace(file: updatedFile, replaceFilterFile: 'gradle.properties')
               }
           }
       }
   }
}

 


/*intellijPlatformTesting {
   runIde{
       systemProperty('compiler.process.debug.port', '8000')
   }

}*/

 

 

0
1 comment

I have just tried your setup on my end, and the IDE was correctly resolved, which means the `defaultRepostiories()` was successfully applied to the root project.

Please consider moving from Groovy to Kotlin DSL for Gradle build configuration files, which may help debug the issue.

0

Please sign in to leave a comment.