Maven - activate profile based on project property

前端 未结 3 982
有刺的猬
有刺的猬 2021-02-14 04:30

Hi I am trying to achieve something like this:

In a parent pom, I have


  
    
      Compil         


        
3条回答
  •  春和景丽
    2021-02-14 05:05

    Yes you can activate the profile depending one or variety of parameters like env variables.

    
        ...
        
            
                development
                
                    
                        !environment.type
                    
                
            
        
    
    

    If you are trying to have different packaging depending on X than you can use the assembly plugin and do your magic there http://maven.apache.org/plugins/maven-assembly-plugin/

    More on the activation property

    • http://books.sonatype.com/mvnref-book/reference/profiles-sect-activation.html
    • http://earlyandoften.wordpress.com/2011/02/09/disable-maven-profile/

提交回复
热议问题