Maven plugin executes multiple times during build

后端 未结 1 1396
野性不改
野性不改 2021-01-12 02:42

I have a Maven project with multiple overlapping profiles. I want to display the active profiles at the beginning of every build. So I put the following into the pom

1条回答
  •  再見小時候
    2021-01-12 03:38

    The reason it executes several times, is because one of your plugins is executing another lifecycle as part of its mojo.

    source:jar definitely does it, as specified by its documentation.

    Invokes the execution of the lifecycle phase generate-sources prior to executing itself.

    jar:jar usually does not, but it may be that you have another plugin that spins off another lifecycle.

    In case of generation of source jar, you generally don't need another lifecycle, and plugin authors recognized this by implementing jar-no-fork mojo.

    You may substitute it for default jar mojo, by following steps described here -> http://maven.apache.org/plugins/maven-source-plugin/usage.html

    0 讨论(0)
提交回复
热议问题