Use an alternative Maven Profile during test phase

前端 未结 2 648
一个人的身影
一个人的身影 2021-02-11 01:34

I\'m trying to build an application starting from an Appfuse Archetype, but I get some strange problems. For once I\'d like to use a hsqldb for automated unit tests and integrat

2条回答
  •  野性不改
    2021-02-11 02:40

    I'm not sure if this is exactly what you are asking for, but you can do the following to setup multiple filters for your Maven project.

    
      /your/path/filter-${env}.properties
    
    

    This way you can setup multiple profiles using:

    
      
        local
        
          local
        
      
      
        test
        
          test
        
      
    
    

    You can then run the build with the relevant property file using:

    mvn -P 
    

    This would require having property files located at:

    /your/path/filter-local.properties
    /your/path/filter-test.properties
    

提交回复
热议问题