idea 14, resource files not copied

I have .fxml files along my .java files in the same directory. Since upgrade to Intellij Idea 14 the fxml files are not copied during build to the build directory.
Has something changed, is it a bug, what are the relevant settings?
Thanks.

5 comments
Comment actions Permalink

Is your project Gradle- or Maven-based, or it was created in IntelliJ IDEA from scratch?

--
Nikolay Chashnikov
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

It's gradle based and I have following in my build.gradle

processResources {
        from (sourceSets.main.resources.srcDirs) {
                include '**/*'
        }
        from (sourceSets.main.java.srcDirs + sourceSets.main.groovy.srcDirs) {
                include '**/*.fxml'
        }
}

0
Comment actions Permalink

try to add the following code into you gradle script as a workaround:

sourceSets {
    main {
        resources {
            srcDirs += sourceSets.main.java.srcDirs + sourceSets.main.groovy.srcDirs
            exclude '**/*.groovy'
            
exclude '**/*.java'
        
}
    }
}


I created related issue for the support of CopySpec configuration of processResources gradle task.
You can watch/vote the issue at https://youtrack.jetbrains.com/issue/IDEA-133047

Message was edited by: Vladislav Soroka

0
Comment actions Permalink

I'm having a very similar issue: I have resources that are in the src/test/resources folder, but they don't seem to be copied during compile as they always used to be.

So, my Spring JUnit tests don't run inside IDEA.

I do have the project synced up with Gradle, but it's not doing anything unusual with resources.   There are no resources in the src/main/java directory or anything like that.

Is there a workaround?

0
Comment actions Permalink

May be some external process removes files from IDEA resources compile output directories, which is (by default) same as Gradle uses (e.g. it can be invocation of 'clean' gradle task).

First, you can try to perform 'Rebuild Project' and check if resources copied into "<your_project_path>/build/resources/main" directory.

Also you can configure IDEA compiler output folders explicitly in your gradle scripts:

allprojects {
    apply plugin: 'idea'
    idea {
        module {
            inheritOutputDirs = true
        }
    }
}
2

Please sign in to leave a comment.