简体   繁体   中英

Maven call automatically the release prepare when activated a profile

I do not have much experience with Maven profiles .... I do not know if Maven can do this, but it definitely could be useful to me ...

Is possible to define a profile, which when called, automatically run the maven release plugin prepare goal?

I explained better ....

instead of:

mvn release: prepare 

I would like to call

mvn install-pProfileThatPerformThePrepare

that automatically perform the prepare ...

Thank you....

You just have to bind an execution of the plugin to a phase (eg "install" in your example):

    <profile>
        <id>my-profile</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.1</version>
                    <executions>
                        <execution>
                            <phase>install</phase>
                            <goals>
                                <goal>prepare</goal>
                            </goals>
                            <configuration>
                                <updateWorkingCopyVersions>false</updateWorkingCopyVersions>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM