Web resources filtering with Maven war plugin does not work in Eclipse with m2e

后端 未结 6 1780
感情败类
感情败类 2021-01-30 14:37

I\'m trying to filter a Spring configuration file using Maven filtering. My POM is configured like this:

        ...
        
          

        
6条回答
  •  天命终不由人
    2021-01-30 14:55

    I've tried everything described above without success. The files were filtered and generated correctly at the "m2e-wtp" folder, but for some reason Eclipse was copying files from "target/classes".

    Thus, I've changed my pom.xml, changing the destination folder from "m2e-wtp" to "target/classes", like code ahead.

    Important: everytime you need to run a maven build on project, you must change the pom in order to build de project.

    
        org.apache.maven.plugins
        maven-war-plugin
        2.4  
        
            false
            
                ${project.basedir}/src/main/filters/${build.profile.id}/config.properties
            
            
                
                    true
                    ${project.basedir}/src/main/resources
                    ${project.basedir}/target/classes
                    
                        *.properties
                        *.xml
                        META-INF/spring/*.xml
                    
                
            
        
    
    

提交回复
热议问题