Give it a try to 12.3 beta1. Well it might not get drastic changes,
there are a few improvements made unfortunately not as many as I'd liked.
https://github.com/apache/netbeans/pulls?q=is%3Apr+is%3Aclosed+milestone%3A12.3+label%3AGradle
Though even if it won't entirely resolve your issues this one could help:
https://github.com/apache/netbeans/pull/2629
These are in 12.3-beta1
On 1/28/21 11:44 PM, Thomas Kellerer wrote:
Hello,
I am working with a gradle project that uses multiple sub-modules, something
along the lines:
project
module_1
module_2
module_3
module_4
Despite the fact that the build on the command line works just fine (and none
of the IntelliJ users have a problem), NetBeans complains that one of the
sub-modules cannot be found.
module_1 is used to build a docker container, if that makes a difference. The
project is setup to use the local gradle wrapper.
module_2 uses classes from module_1, but NetBeans marks module_2 with the yellow
exclamation mark and the tooltip says: "cannot resolve project :module_1".
The configurations node also has the yellow exclamation mark and the tooltip says
"There are unresolved configurations".
When I open build.gradle for module_2, I see the following lines at the top:
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.bmuschko.gradle.docker.tasks.image.DockerPushImage
import com.bmuschko.gradle.docker.tasks.image.DockerRemoveImage
which are all underlined with the red squiggly line, so NetBeans doesn't know
what to do (again: gradle on the command line works just fine)
Doing a "Clean and build" (which works without an error) of the main project or
each module separately from within NetBeans doesn't fix this.
When I open a class in module_2 that uses classes from module_1, things look OK. But if I
e.g. use "Find usages" on one of the classes in module_1, the classes from
module_2 are not found. So it seems module_2 isn't properly recognized by NetBeans.
This also means that "Fix imports" or "Fast import" don't work across the
modules, which forces me to manually write the necessary import statements (which then in turn work
as the class can be compiled).
Opening gradle projects has never bee a pleasant experience for me with NetBeans, I
constantly have to go to the command line to "fix" things in NetBeans (again,
none of the IntelliJ users have a problem). As I am the only one using NetBeans, I can't
really address this in the team.
I cannot disclose the build scripts (or even the whole project) as this is
confidential.
Any ideas how I can convince NetBeans to detect the sub-modules correctly?
I am willing to give 12.3-beta a try if someone says it drastically improved
the gradle support.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists