Profile activation on both release:prepare and release:perform

前端 未结 4 1551
长发绾君心
长发绾君心 2020-12-30 05:17

I cannot find a solution for activating some Maven profile on release:prepare and release:perform (both) goals. Something like this:



        
4条回答
  •  悲&欢浪女
    2020-12-30 05:35

    This looks like a duplicate question. Please take a look at this question, it has an answer. maven release plugin ignores releaseProfile

    Basically version 2.2.1 of the release plugin adds a releaseProfiles parameter that will allow you to define the profiles to enable during release.

    http://maven.apache.org/plugins/maven-release-plugin/examples/perform-release.html

    Unfortunately, it looks like there's a bug that will prohibit it from doing what you want...

    Edit

    One thing that I have used in this case is not using the -P argument, but rather triggering the profile through an environment setting using -Denv=release. Then in the POM, I have the profile activation based on the value of env. This has always worked for me.

提交回复
热议问题