How to bind plugin mojos (goals) to few phases of default lifecycle?

China☆狼群 提交于 2019-12-03 12:09:45

You can achieve that by replacing ugly-fix with correct goals in <phases> tag:

<component-set>
  <components>
    <component>
        <role>org.apache.maven.lifecycle.Lifecycle</role>
        <implementation>org.apache.maven.lifecycle.Lifecycle</implementation>
        <role-hint>accurest</role-hint>
        <configuration>
            <id>accurest</id>
            <phases>
                <process-test-resources>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:convert
                </process-test-resources>
                <generate-test-sources>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:generateTests
                </generate-test-sources>
                <package>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:generateStubs
                </package>
            </phases>
            <default-phases>
                <process-test-resources>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:convert
                </process-test-resources>
                <generate-test-sources>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:generateTests
                </generate-test-sources>
                <package>
                    io.codearte.accurest:accurest-maven-plugin:${project.version}:generateStubs
                </package>
            </default-phases>
        </configuration>
    </component>
</components>

I think what you are looking for is the defaultPhase attribute of the Mojo annotation, see https://maven.apache.org/components/plugin-tools/maven-plugin-tools-annotations/ for all the details.

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