Question

I'm trying to configure the maven-release-plugin's perform mojo in the pom to only execute the deploy goal (as opposed to the default deploy site-deploy). From the command line, it's as simple as the following:

mvn release:perform -Dgoals=deploy


Here are attempts at configuring the pom, both of which failed.

Attempt 1:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <executions>   
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>perform</goal>
                        </goals>
                        <configuration>
                            <arguments>-Dgoals=deploy -Dgit.tag.previous=</arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <preparationGoals>clean install</preparationGoals>
                    <arguments>-Dgit.tag.previous=</arguments>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    ...
</build>

Attempt 2:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <preparationGoals>clean install</preparationGoals>
                    <arguments>-Dgoals=deploy -Dgit.tag.previous=</arguments>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    ...
</build>

Despite these changes in configuration, I'm still seeing the following log line when I do a mvn release:perform:

....
[INFO] Executing goals 'deploy site-deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building SearchService
[INFO] [INFO]    task-segment: [deploy, site-deploy]
[INFO] [INFO] ------------------------------------------------------------------------
...

Note the 'site-deploy' in task-segment.


Any help is very much appreciated!

Was it helpful?

Solution

You're thinking way too complex. The perform#goals describes what you want. So it is just

<configuration>
  <goals>deploy</goals>
</configuration>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top