Maven - activate profile based on project property

前端 未结 3 974
有刺的猬
有刺的猬 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:20

    It won't work since...

    To begin with:

    • Profile activation works with system properties and not with Maven properties.

    And why it would not work from the parent down to the children:

    • The properties in the parent POM are expanded before your child POM even comes in the picture.

    Many have gone here before you and failed.

    One might wonder what you are really trying to do. Are you building different artifacts from the same source project? Perhaps you need a few more Maven modules to take care of things.

提交回复
热议问题