DenisKusakin / aem-groovyconsole-idea-plugin

Plugin for running groovy scripts on AEM server from IntelliJ IDEA
14 stars 2 forks source link

AEM imports not working #18

Closed tadijam64 closed 4 years ago

tadijam64 commented 4 years ago

I have a problem with first usage of this plugin. I set server in settings and installed plugin. After that marked directory with groovy files as Groovy directory. I am using IntelliJ 2018.3.4v and JRE 1.8.0.

The problems occur when I try to run the program that is successfully run in browser AEM groovy console (on server). AEM imports are not recognized and the program can not be run due to following exception:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: `/.../.../engines/core/src/main/java/we/retail/core/groovyScripts/assetUpdate.groovy: 4: unable to resolve class org.apache.sling.api.resource.ValueMap @ line 4, column 1. import org.apache.sling.api.resource.ValueMap ^

/.../.../engines/core/src/main/java/we/retail/core/groovyScripts/assetUpdate.groovy: 3: unable to resolve class org.apache.sling.api.resource.Resource @ line 3, column 1. import org.apache.sling.api.resource.Resource ^

/.../.../engines/core/src/main/java/we/retail/core/groovyScripts/assetUpdate.groovy: 2: unable to resolve class org.apache.sling.api.resource.ModifiableValueMap @ line 2, column 1. import org.apache.sling.api.resource.ModifiableValueMap ^

3 errors

Process finished with exit code 1`

DenisKusakin commented 4 years ago

Hi @tadijam64 The plugin does not perform any compilation, so such error message looks a bit odd for me Could you please make a screenshot of what you see in your IDE?

tadijam64 commented 4 years ago
Screenshot 2019-09-26 at 22 00 30
DenisKusakin commented 4 years ago

Looks like you are trying to execute groovy via default IntelliJ groovy console Try to close run tab with wrong execution (red square) and then execute the script again using CTRL + Enter or by clicking run icon next to your AEM server name (yellow square) 65720947-531cc500-e0a9-11e9-90da-85a9570ad005

tadijam64 commented 4 years ago

Thank you. I thought it should be run with intelliJ groovy console. It would be good to mention this somewhere in README file. If it is already somewhere written, I apologise for the confusion :)

DenisKusakin commented 4 years ago

Thank you for your feedback, I agree that it might confuse I will mention it somewhere