Inheriting Maven profiles

你。 提交于 2019-11-30 06:41:54

问题


Is it possible for a child POM to inherit profiles defined in the parent POM? If so, how?


回答1:


Profiles defined in a parent POM are inherited in a child POM extending the parent, there is nothing to do. And just in case, the Maven Help Plugin has very useful goals allowing to deal with profiles:

  • help:active-profiles : lists the profiles which are currently active for the build.
  • help:all-profiles : lists the available profiles under the current project.



回答2:


I don't think it is inherited. http://www.dashbay.com/2011/03/maven-profile-inheritance/ http://looking4q.blogspot.com/2011/01/maven-profiles-inheritance.html You may find the profiles available is very likely because they are activated by default




回答3:


It's not just possible, it's mandatory. If you declare a parent POM, you get all its profiles.




回答4:


I tested profile inheritanced with maven 3.3.9. If the parent pom declares the child module (aggregation), the profile is visible in the child module. If the parent pom does not declare de child module (inheritance), the profile is not visible.



来源:https://stackoverflow.com/questions/3695394/inheriting-maven-profiles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!