How to invoke the same maven build twice in one call

后端 未结 1 2021
醉话见心
醉话见心 2020-12-03 17:27

Is it possible to invoke the same maven build a number of times with different configuration parameters?

I have a maven build that creates a number RPMs with the rpm

相关标签:
1条回答
  • 2020-12-03 17:55

    I believe the only way to achieve that during one maven execution is to bind several executions of the plugin (with different configurations) to a lifecycle phase, like this:

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <id>test-1</id>
                        <configuration>
                            ...
                        </configuration>
                        <goals><goal>test</goal></goals>
                    </execution>
                    <execution>
                        <phase>test</phase>
                        <id>test-2</id>
                        <configuration>
                            ...
                        </configuration>
                        <goals><goal>test</goal></goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        ...
    </build>
    

    You can attach this configuration to some profile triggered by one property (e.g. by mvn package -Denvironment=all).

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