idea 14, resource files not copied

Answered

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.

0
7 comments
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

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
Avatar
Permanently deleted user

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

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

Hello,

I'm using IntelliJ IDEA 2024.1.1 (Community Edition)
Build #IC-241.15989.150, built on April 29, 2024
Runtime version: 17.0.10+1-b1207.14 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
Registry:
 terminal.new.ui=true
Non-Bundled Plugins:
 AntSupport (241.14494.158)
Kotlin: 241.15989.150-IJ
 

With a non-maven javaFX project, and my resources are not copied in the target directory. I dont know what happened.

0

Eriks33paris75002 Could you please clarify which Build System your Project is using and if it has any explicit configuration is regards to processing the Project's resources?

0

Please sign in to leave a comment.