How to replace a value in web.xml with a Maven property?

前端 未结 6 489
滥情空心
滥情空心 2020-12-03 06:35

I have a Maven project that downloads some test files into its build directory ./target/files. These files should then be available to a servlet, which I can ea

6条回答
  •  生来不讨喜
    2020-12-03 06:56

    You can simply use maven filtering resources:

    
        ...
        
          
            src/main/resources
            true
          
          ...
        
        ...
      
      ...
    
    

    You can also combine this and would like to filter some files whereas others shouldn't be filtered:

       
          
            src/main/resources
            true
            
              **/*.xml
            
          
          
            src/main/resources
            false
            
              **/*.xml
            
          
          ...
        
    

    Put appropriate placeholders into the files you would like having replaced things like ${home}.

提交回复
热议问题