F. Zi
F. Zi

Reputation: 41

Gradle tasks shown in intellij but can not be run

I have a multi module project with the following structure:

  1. root_project
    1. module1
    2. module2
    3. module3

I try to apply the java plug-in to all projects using the following code:

allprojects {
    apply plugin: 'java'
    group = 'com.mysoftware'
    sourceCompatibility = 1.8
    version = '1.3'

    repositories {
        mavenCentral()
    }
}

Additionally I add the javafx plugin to module3. The java and javafx tasks are now shown in the intellij gradle view, but when trying to execute them, I get this error:

Task 'jfxJar' not found in root project 'module3'.

Furthermore, running the tasks task show me that neither the java tasks nor the javafx tasks are available, despite being shown in the gradle view in intellij. I tried rebuilding and refreshing the whole project without success. I use the Use default gradle wrapper configuration.

Upvotes: 0

Views: 1702

Answers (1)

M.Ricciuti
M.Ricciuti

Reputation: 12086

The error message you got Task 'jfxJar' not found in root project 'module3' indicates that Gradle considers the subproject module3 as a Root project: this can happen if you created a settings.gradle file in the sub-project directory, which is not a valid setup (only one settings.gradle file can exist in a multiproject build, located in the root directory)

Upvotes: 2

Related Questions