Question

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....

Was it helpful?

Solution

You just have to bind an execution of the plugin to a phase (e.g. "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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top