Inherited profiles in Maven

前端 未结 5 957
夕颜
夕颜 2020-12-15 11:07

I have the following profiles in my parent pom


    P1
    
        true         


        
5条回答
  •  情深已故
    2020-12-15 11:34

    The problem is not with inheritance but with interpolation (i.e. which values are supported for ${...}): file-based profile activation only supports limited interpolation: see http://maven.apache.org/pom.html#Activation

    So ${project.basedir} isn't supported but only ${basedir} (and system properties).

    For more details, you can have a look at the model building algorithm: http://maven.apache.org/ref/3.2.1/maven-model-builder/

    Full model interpolation happens after profile activation: so even if your effective pom shows interpolated value for ${project.basedir}, the value isn't calculated when profile activation happens.

    In Maven 3.2.2, there are multiple enhancements regarding this: documentation in http://jira.codehaus.org/browse/MNG-5590, warning at runtime in http://jira.codehaus.org/browse/MNG-5608 and better effective pom result http://jira.codehaus.org/browse/MNG-5612

提交回复
热议问题