Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4126

Tasks on Sub-projects of a Gradle build are invoked by changing to the sub-project directory first, this can change the project hierarchy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 11.3
    • None
    • projects - Gradle
    • None
    • macOS 10.15.4
      Gradle 6.3
      NetBeans 11.3 running on JDK-14
      Project configured to compile with JDK-8

    Description

      I have a multi-project Gradle project with a parent project and several sub-projects. However, in the sub-project folders I have a settings.gradle file, so if gradle is invoked from within the sub-folder the sub-project behaves as a root project. This is intentional.

      When I open the parent project in NetBeans, the sub-projects are correctly identified as belong to the parent project, but when build actions are done on them the gradle command is invoked from the sub-folder, e.g.:

      JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home"
      cd /Users/scott/dev/Kayak/MyParentProject/MySubProject; /Users/scott/dev/gradle/bin/gradle --configure-on-demand -x check build

      Instead the build target should be augmented with the project path:

      JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home"
      cd /Users/scott/dev/Kayak/MyParentProject; /Users/scott/dev/gradle/bin/gradle --configure-on-demand -x check :MySubProject:build

      Attachments

        Activity

          People

            lkishalmi Laszlo Kishalmi
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: