业务对处理器单线程性能要求比较高,请问有人实测对比过SA2和S5吗?
您是正确的,默认情况下,Maven将包括您配置的所有执行。我以前是这样处理这种情况的。
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>some-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>first-execution</id>
<phase>none</phase>
<goals>
<goal>some-goal</goal>
</goals>
<configuration>
<!-- plugin config to share -->
</configuration>
</execution>
<execution>
<id>second-execution</id>
<phase>none</phase>
<goals>
<goal>other-goal</goal>
</goals>
<configuration>
<!-- plugin config to share -->
</configuration>
</execution>
</executions>
</plugin>
</pluginManagement>
注意,这些执行被绑定到none
。在子程序中,您启用了应该执行的部分,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>some-maven-plugin</artifactId>
<executions>
<execution>
<id>first-execution</id> <!-- be sure to use ID from parent -->
<phase>prepare-package</phase> <!-- whatever phase is desired -->
</execution>
<!-- enable other executions here - or don't -->
</executions>
</plugin>
如果子程序没有显式地将执行绑定到一个阶段,它就不会运行。