IntelliJ Grails project not seeing /src/main/groovy - intellij-idea

Versions
IntelliJ 2021.1.2
Grails 4.0.10
JVM 11.0.2
Grails works and can see the source in /src/main/groovy just fine but IntelliJ can not. I see the following error "Cannot resolve symbol 'SamConfig'". SamConfig is a simple groovy class for holding configuration.
The src/main folder is set up as a SourceFolder in the parent module of the project. The grails-app is a submodule called main. Please let me know if I can provide any more details to help solve this issue.
Thanks
Larry

The src/main folder is set up as a SourceFolder in the parent module
of the project.
You should set src/main/groovy/ to be a source root, not src/main/.

Related

How to open pom.xml project using IDEA

I am trying to learn about annotation processing by looking at this sample.
I've cloned it to my local machine and used IDEA to open it.
However IDEA tells me:
Project SDK not set up.
After setting up Java SDK, the project is not opening correctly. So how can I open this project?
The project structure :
annotationprocessing10
|
|------factory
|-----annotation
|------pom.xml
|-----processor
|------pom.xml
|-----pom.xml
|-------factory-sample
I tried opening annotationprocessing10 (root) directly and also tried factory directly but neither worked. Here is a screenshot of the directory structure:
The given repo is not a maven module (no POM.xml in the base directory), the maven modules are the projects inside.
Make sure you import the modules inside the root directory in IDEA to identify it as a maven project.

Error:Could not find property 'semanticVersion' on root project

My IntelliJ java Gradle project failed with the error.
Error:Could not find property 'semanticVersion' on root project 'MY_PROJECT_NAME'.
It did not create src and other folders.
I've got this error when trying to create a new Gradle Java project. After I have created project with auto folder generation option in IntelliJ wizard, I did not see any of the source or grade wrapper folders. Also, the project build failed everytime with error
Error:Could not find property 'semanticVersion' on root project 'MY_PROJECT_NAME'.
The final solution was that there was no "gradle.properties" file in my project. After I have created a new file "gradle.properties" and added line 'semanticVersion=1.0.0' to it, everything worked fine. Hope this helps someone.

maven build - IntelliJ

I am trying to create a jar in IntelliJ through maven clean-compile-package. Build is sucessful but I am not getting class and packages in tha jar. Please help! I got below warning in logs:
[WARNING] JAR will be empty - no content was marked for inclusion!
maven project have default standard directory layout its documented here
if you not followed them or moved folders around, maybe changed output folder or similar action was taken, maven can't correctly decide how to include your class files.

Some classes can't be resolved when compiling Apache Drill?

I built the Drill project according to the wiki specification
but, the project has some errors. Some classes (BigIntVector, BitHolder,BigIntHolder) can't be resolved and the workspace don't really contain these class files. Any suggestions as to what's going on?
These clases are generated during build.
exec/java-exec/target/generated-sources/org/apache/drill/exec/expr/holders/BigIntHolder.java
There is a problem in that the Maven import into eclipse results in target/generated-sources/org being added to the Source Folder build path. I have found that in the two cases, comon and java-exec, if you remove these folders from the source folder build path and add them as target/generated-sources this will help.
This is a workaround, there is obviously a misconfigured pom.xml somewhere.

Eclipse RCP: Dependencies correct (?) but get a NoClassDefFoundError

I have a RCP project where I cannot fix a NoClassDefFoundError: One plugin depends on another plugin. The plugin-dependencies are set in the manifest, packages exported, and there is no error at compile time. Both plugins are in the product dependencies and visible in the installation details of the product.
But when I run the application I get a java.lang.NoClassDefFoundError when the one plugin wants to use a class from the other plugin.
Any hints how to find the reason for this are greatly appreciated.
Thanks,
Michael
I found the problem: I created the plugin which could not be loaded from an existing Java project. And somehow I deleted the "." in the entry Bundle-classpath in the plugin manifest (the plugin has some jars which -> so lib/xyz.jar was in the Bundle-classpath entry but not the ".").
For the class-loader of the bundle the "." means to search for classes from the root path of the bundle (or something like that), so it could not find the classes. However, there were no errors in the IDE so it was hard to find.
Is the configuration for running the application correct i.e. all dependencies are also put in the running configuration?