Gradle and Intellij
Hi
I've started a JavaFX project using Intellij 2018.1, JDK 9 and Gradle. Suddenly I am more fighting with the development environment then my programming tasks. Fixing one problem, causing another problem to show up. My problems are relation both to Gradle and to Intellij so I am not sure that I am in the correct forum.
As I understand documentation is that if you import a Gradle project to Intellij, the IDE environment will be set up correctly to be able to run and debug your project. This is not correct in my case. My application is running nice but opening a java file in IDE,, indicates ton's of errors. Apparently IDE not agreeing with Gradle run task.....
My gradle file looks like this:
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'javafx-gradle-plugin'
apply plugin: 'idea'
idea {
module {
outputDir file('build/classes/main')
testOutputDir file('build/classes/test')
}
}
repositories {
mavenCentral()
jcenter()
maven {
url 'https://mymavenrepo.com/repo/iL9Nqx2ux6TDhVvQyAez/'
}
}
mainClassName = 'com.consius.purchaseList.MainApplication'
sourceSets {
main {
output.resourcesDir 'build/classes/main'
output.classesDir 'build/classes/main'
}
test {
output.resourcesDir 'build/classes/test'
output.classesDir 'build/classes/main'
}
}
sourceSets.main.resources.srcDir 'src/main/java' //NOTE1
buildscript {
repositories {
mavenCentral()
}
}
dependencies {
........
}
NOTE1) The javaFX xml file is placed in source directory and needs to be copied to classes directory to make Weld container find it.
I would like Gradle and Intellij IDE work seamless being able to run, debug application and unit tests.
How does a correct setup look.
Please sign in to leave a comment.
Please report at https://youtrack.jetbrains.com/issues/IDEA and attach a sample project to reproduce the problem.