Inherited profiles in Maven

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

I have the following profiles in my parent pom


    P1
    
        true         


        
5条回答
  •  别那么骄傲
    2020-12-15 11:28

    In general, Maven profiles are not inherited (see http://jira.codehaus.org/browse/MNG-5127 for a discussion and links to blog posts that might be useful). I've had success doing something like this:

    
    
        P2
        
            
                ${project.basedir}/src/main/whatever
            
        
        
    
    
    
    
    
    
        P2
        
            
                ${project.basedir}/src/main/whatever
            
        
    
    

    Also I think that P1 will not be active if P2 is. This is because is true for P1. The element name is a little misleading in my opinion. "Active by default" implies "always active" when it really means "active only if no other profile in this POM is active."

    The above discovered using Maven 3.0.x.

提交回复
热议问题