我正在使用Maven 3.0.3.对于我们的项目集成测试,我们需要使用Unix命令创建虚拟帧缓冲区.但是,当我们在Windows机器上运行我们的项目时,我们不需要这个.我们用
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>start-xvfb</id>
<phase>process-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Starting xvfb ..." />
<exec executable="Xvfb" spawn="true">
<arg value=":0.0" />
</exec>
</tasks>
</configuration>
</execution>
<execution>
<id>shutdown-xvfb</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Ending xvfb ..." />
<exec executable="killall">
<arg value="Xvfb" />
</exec>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当平台不是windows时,如何进行上述运行并禁止运行插件?谢谢, - 戴夫
Cor*_*bba 20
您可以使用配置文件执行此操作 OS设置有配置文件激活开关.插件非常聪明,你可以使用否定.
<profiles>
<profile>
<activation>
<os>
<family>!windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
...
</plugin>
</plugins>
</build>
...
</profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)
有关配置文件的更多信息,请参见此处,以及您可以在此处使用的值.
| 归档时间: |
|
| 查看次数: |
5111 次 |
| 最近记录: |