IntelliJ: how to make non java files copied to the bin directory as well?

前端 未结 4 1557
失恋的感觉
失恋的感觉 2020-12-08 16:02

My module contains some non java files along the java source files. When the module is built, the java files are copied to the bin folder (and included in the jar artifact),

4条回答
  •  萌比男神i
    2020-12-08 16:47

    On IDEA 14.1.4, the xml file in src/main/java/my/package folder is not copied. My compiler settings are !?*.java;!?*.form;!?*.class;!?*.groovy;!?*.scala;!?*.flex;!?*.kt;!?*.clj;!?*.aj.

    I changed the gradle file by adding:

    test {
        resources {
            srcDir 'src/main/java'
            include '**/*.xml'
        }
    }
    

    It starts working. I am not sure if I have missed anything, but I could not find that part reflected on project settings.

    If you are working with Maven, the following code should have the same effect:

    
        
            
                false
                src/test/java
                
                    **/*.xml
                
            
            
                src/test/resources
            
        
    
    

    I posted it here as an answer, because it may help someone who has the same issue and the above answers may not work.

提交回复
热议问题