Background
I have been trying to migrate my existing IntelliJ IDEA plugin to use Gradle. In order to do this, we have to use the Gradle IntelliJ Plugin
When I tried to add Gradle support, I kept on noticing that I was getting a bunch of
unable to resolve symbol "x"
issues in my
build.gradle
file (those are all the red in the above picture). I noticed that the dependencies were updating; however, I was getting another issue that seemed more severe.
GitHub Issue
See the below link for the issue that I submitted. It was closed due to the fix not being related to the plugin, but to Gradle configuration apparently.
opened 08:12AM - 14 Aug 17 UTC
closed 09:33AM - 14 Aug 17 UTC
invalid
cannot recreate
I have been trying to migrate my existing project to build with Gradle. Since I … did this, I have noticed that my gradle files are not recognized fully. As you can see in the image, I have a lot of issues in my code that all are related to `unable to resolve symbol "x"` .
Now, you can see that Gradle is working (I guess) as the dependencies were updated (dependency list) after I updated them (`IC-2016.3 --> IC-2017.2`).
![2_chromaterial-unresolved-symbols](https://user-images.githubusercontent.com/8707125/29261440-73069bd0-810a-11e7-9ec1-d172b1dc7d35.PNG)
# idea.log
Here are 3 or 4 error messages I recieved from idea.log
~~~
2017-08-12 14:14:19,050 [164393102] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:19,094 [164393146] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:24,143 [164398195] WARN - nal.AbstractExternalSystemTask - Could not find gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.2.16.
Searched in the following locations:
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
Required by:
project :
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not find gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.2.16.
Searched in the following locations:
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
Required by:
project :
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:230)
at org.jetbrains.plugins.gradle.service.task.GradleTaskManager.executeTasks(GradleTaskManager.java:163)
at org.jetbrains.plugins.gradle.service.task.GradleTaskManager.executeTasks(GradleTaskManager.java:58)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManagerImpl.lambda$executeTasks$0(RemoteExternalSystemTaskManagerImpl.java:48)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManagerImpl.executeTasks(RemoteExternalSystemTaskManagerImpl.java:47)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemTaskManagerWrapper.executeTasks(ExternalSystemTaskManagerWrapper.java:53)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemExecuteTaskTask.doExecute(ExternalSystemExecuteTaskTask.java:152)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
at com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration$MyRunnableState.lambda$execute$0(ExternalSystemRunConfiguration.java:300)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:343)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-08-12 14:14:31,262 [164405314] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:31,317 [164405369] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:31,346 [164405398] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'C:\Users\Christopher\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\prebuilts\tools\common\offline-m2'
2017-08-12 14:14:31,383 [164405435] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=2017.2.1 -Didea.resolveSourceSetDependencies=true -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true --init-script C:\Users\Christopher\AppData\Local\Temp\ijinit.gradle
2017-08-12 14:14:33,074 [164407126] INFO - #git4idea.repo.GitConfig - No branch.release/1.2.merge/rebase item in the .git/config
2017-08-12 14:14:35,267 [164409319] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:35,321 [164409373] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_05
2017-08-12 14:14:37,219 [164411271] INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.0.2-all.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:255)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:81)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:904)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:888)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:222)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:140)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:81)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:87)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:410)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:477)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:548)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:343)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'ChroMATERIAL Plugin'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
at org.gradle.initialization.DefaultGradleLauncher$1.run(DefaultGradleLauncher.java:124)
at org.gradle.internal.work.DefaultWorkerLeaseService$2.execute(DefaultWorkerLeaseService.java:124)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:116)
at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:104)
at org.gradle.launcher.exec.GradleBuildController.configure(GradleBuildController.java:74)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:65)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:50)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'ChroMATERIAL Plugin'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:87)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:65)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)
at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:654)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:132)
at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:60)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:195)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:44)
at org.gradle.initialization.DefaultGradleLauncher$1.run(DefaultGradleLauncher.java:122)
... 56 more
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:882)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1500(DefaultConfiguration.java:114)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:856)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:382)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:73)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:191)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:161)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:167)
at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:63)
... 76 more
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.2.16.
Searched in the following locations:
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
https://repo1.maven.org/maven2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.jar
Required by:
project :
at org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(DefaultBuildableComponentResolveResult.java:38)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:105)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:60)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$ComponentMetaDataResolverChain.resolve(ComponentResolversChain.java:93)
at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:45)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ComponentState.resolve(DependencyGraphBuilder.java:854)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ComponentState.getMetaData(DependencyGraphBuilder.java:865)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$EdgeState.calculateTargetConfigurations(DependencyGraphBuilder.java:446)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$EdgeState.attachToTargetConfigurations(DependencyGraphBuilder.java:417)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:223)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:213)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:148)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:121)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:86)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:138)
at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:73)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:66)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$4.run(DefaultConfiguration.java:469)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:461)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:437)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:114)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getSelectedArtifacts(DefaultConfiguration.java:865)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:853)
... 92 more
~~~
Apparent Issue and Possible Fix
It was suggested that I am pointing to the wrong pom file.
I should use this …
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/intellij/plugins/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
…not…
https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle-intellij-plugin/0.2.16/gradle-intellij-plugin-0.2.16.pom
Question
So how do I change which pom file Gradle uses to download Gradle IntelliJ Plugin v0.2.16?
I never configured anything with pom files before, and the setup tutorials for the Gradle IntelliJ Plugin never contained any information for this. I just used the provided code snippets and build my project.
Code Links
I have 2 branches. master
branch has no Gradle support, while feature/add-gradle-support
use the code and configurations for Gradle.
Note: Nothing in my included and excluded files links to pom files
tim_yates
(Tim Yates)
August 16, 2017, 7:17am
2
Hiya!
I cloned your project, and gave it a go and it seems to work for me.
One suggestion would be to remove the buildscript
section and the duplicate plugin
application.
I changed the build.gradle
to:
plugins {
id "org.jetbrains.intellij" version "0.2.16"
}
apply plugin: 'idea'
intellij {
version 'IC-2017.2' //IntelliJ IDEA 2016.3 dependency; for a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
pluginName 'ChroMATERIAL'
type 'IC'
updateSinceUntilBuild false
}
group 'io.github.ciscorucinski.chromaterial'
version '2.0' // Plugin version
ran ./gradlew idea
, opened it in IntelliJ and none of it’s red?
I’m on IntelliJ 2017.2.1 if that is the issue?
Cheers,
Tim
Thanks Tim for the reply. So, I modified my build.gradle
file and ran the specified idea
task and then reopened IntelliJ IDEA; however, everything is still the same.
Just to be clear, when you say none is red, do you mean that there are no errors (as I am using a different color scheme. The Darcula color scheme will have everything grey and underlined instead of red).
I did notice that when I reopened IntelliJ IDEA, the Gradle tool window did not have any dependencies within the main and test source sets. However, when I re-added the duplicate apply plugin: org.jetbrains.intellij
line, those dependencies came back. But once I removed the line again, those dependencies stayed.
Also, I use to have intellij.version
be set to IC-2016.3
and that was showing the 2016.3 dependencies correctly. Then I changed intellij.version
to be set to IC-2017.2
and the dependencies changed to the 2017.2 versions. So it appears that Gradle is still working, but I have these issues all over
tim_yates
(Tim Yates)
August 16, 2017, 9:29am
4
Hiya, it looks like this:
I don’t see test
and main
source sets, I get loads of provided
and test
dependencies in the project properties -> modules
view though, is this where you mean?
Can you explain what you’re seeing?
The picture looks great. Looks like it works perfectly. I don’t know anything about the project properties -> modules
view
Here you can see multiple things…
Cannot resolve symbol
red issues.
The main
and test
source sets.
The new intellij
tasks from the intellij DSL, which shows the the Gradle file is being parsed.
The com.jetbrains.ideaIC
dependency which shows that the Gradle file is being parsed.
Here is another picture that shows a change to the com.jetbrains.ideaIC
dependency.
tim_yates
(Tim Yates)
August 16, 2017, 4:02pm
7
What’s the root src
folder? I don’t have that from the repo?
OK, I have 2 modules.
ChroMATERIAL Plugin
module.
ChroMATERIAL
source module that contains the plugin itself.
The root src
folder is in ChroMATERIAL/src
I have to modify my Gradle file to indicate that change as the Gradle IntelliJ Plugin
cannot build my plugin properly right now. I am not certain of how to do that just yet, but I want to fix my current issue before I make some possible wrong changes.
Here is my project structure right now…
Now, I have 6 apparent modules (I should only have 2 I believe, but the other ones keep on coming back and I don’t know why)
The 2 correct modules are the selected one (the plugin module) which is named ChroMATERIAL.
The other one is the base module which is named ChroMATERIAL Plugin.
Does this answer your question? I come from Android Studio where most of this just works.
tim_yates
(Tim Yates)
August 16, 2017, 4:54pm
9
That project structure dialog looks horribly wrong… Hmmm…
Can you try removing your intellij files (*.ipr
, *.iml
, *.iws
) from all levels, and re-create the project by simply doing “File -> Open”, and choosing the root build.gradle
file?
Not sure what’s going on here, and can’t reproduce as https://github.com/ciscorucinski/ChroMATERIAL doesn’t have the same content as you are showing me…
Am I suppose to create a new project location? I get a directory is already taken
issue when I selected the current projects directory location, but if I choose a new location, then I cannot use the Gradle wrapper
tim_yates
(Tim Yates)
August 16, 2017, 5:19pm
11
Close IntelliJ window
Remove intellij files from the folder
rm *.ipr
rm *.iml
rm *.iws
Select File -> Open
Choose the build.gradle
file, and click Open
Select “Open as Project”
Click “Ok” on the “Import project from Gradle” dialog
Wait for IntelliJ to finish parsing the script, and all should be good?
Works for me with the code from the repo on Github, but as I said, you have a different codebase to me
That worked to fix the red issues of mine.
I lost the plugin module as it is just a normal module now. I still have a weird looking project structure from modules that I didn’t create or configure.
In my .idea/modules.xml
I have the following…
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ChroMATERIAL/ChroMATERIAL.iml" filepath="$PROJECT_DIR$/.idea/modules/ChroMATERIAL/ChroMATERIAL.iml" group="ChroMATERIAL" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ChroMATERIAL Plugin.iml" filepath="$PROJECT_DIR$/.idea/modules/ChroMATERIAL Plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ChroMATERIAL_Plugin_main.iml" filepath="$PROJECT_DIR$/.idea/modules/ChroMATERIAL_Plugin_main.iml" group="ChroMATERIAL Plugin" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ChroMATERIAL_Plugin_test.iml" filepath="$PROJECT_DIR$/.idea/modules/ChroMATERIAL_Plugin_test.iml" group="ChroMATERIAL Plugin" />
</modules>
The last 2 modules (which contain ChroMATERIAL_Plugin
in the path) are modules that I never specified or configured. In fact, that was the name of a previous project that I originally had before creating the ChroMATERIAL Plugin
project. I don’t know if the above is related to these extra modules are not.
These modules will always come back after a little bit of time after I delete the unnecessary ones. This is also true for the related .iml
files inside of .idea/modules/ChroMATERIAL/
folder.
Maybe I will try to create a new project with Gradle support from the beginning. Have a normal Gradle module with an inner plugin module with Gradle support.
tim_yates
(Tim Yates)
August 16, 2017, 7:00pm
13
That looks ok to me… IntelliJ creates a module for your compile classpath (main) and one for your test classpath (test)
You can alter this on import by deselecting the “separate classpath per module” checkbox
OK, that is good then. I just have to figure out how to get the ChroMATERIAL
module to become an IntelliJ Plugin Module , when I opened the project, it lost that
After I re-instantiated the ChroMATERIAL
module to be an IntelliJ Plugin module, I got back all the red issues.
I assume this is a bug of some kind on the IntelliJ IDEA side. As I have said before, IntelliJ is parsing the file correctly and giving me the right dependencies, so it is reading the issue-prone file correctly.
But thanks for all your help!
zolotov
(Alexander Zolotov)
August 21, 2017, 4:27pm
16
Nothing is wrong with IntelliJ. You have to decide what project model to use: gradle or intellij one. If you’re migrating to gradle why do you need to go back to using plugin module type?
@zolotov I assumed I had to because I am making a plugin. It also allows me to select where the plugin.xml
file is located. Also, I cannot do stuff that I could do with the plugin module type…like prepare plugin for deployment option in the menu.
Edit: Tight now, running the Gradle tasks does nothing. I know that I need to modify my build.gradle
(or add one to the sub-project) and that is the reason why it doesn’t work now, but I assumed all the normal plugin options would still be available.
zolotov
(Alexander Zolotov)
August 21, 2017, 11:17pm
18
@ciscorucinski
It also allows me to select where the plugin.xml file is located.
If you process resources with Gradle, it’s not really an option, the file must be located in <resources_root>/META-INF/plugin.xml
.
like prepare plugin for deployment option in the menu.
There are buildPlugin
or publishPlugin
Gradle tasks for that. Read gradle-intellij-plugin
README to learn more about provided tasks.
@zolotov [quote=“zolotov, post:18, topic:23739”]
There are buildPlugin
or publishPlugin
Gradle tasks for that.
[/quote]
I know about those Gradle tasks, but I also know that my build.gradle
setup was incomplete and that the Gradle tasks wouldn’t do anything. I assumed I would still have the menu items like all plugins did before (i.e. didn’t realize it was an all or nothing approach).
My build.gradle
file is in the main project module (not my plugin module - it contains a lot of Github related content). I still need to add a build.gradle
file to my sub-project (My actual plugin called ChroMATERIAL). I need to figure out what stuff goes in which Gradle file. Can I just have 1 build.gradle
file total (only in my plugin module)?
I wanted to fix all my unresolved symbol
issues before I did any of that listed above.