我正在尝试在 Jenkins 上运行 Sonar。我的项目包含 Junit 和 Cucumber 测试。我在构建之后验证了日志文件,Sonar 构建在正常的 maven 构建之后开始,并且只选择 Junit 测试而不选择 Cucumber 测试。
我的 POM 文件中有以下版本和插件。请让我知道是否有人遇到过类似的问题并解决了它。非常感谢!
Junit 4.11 版 Cucumber 1.1.2 版 Sonar 3.5.1 版
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<executions>
<execution>
<id>start-jetty</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>prepare-package</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<stopPort>8999</stopPort>
<stopKey>STOP</stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8997</port>
<maxIdleTime>3600000</maxIdleTime>
</connector>
</connectors>
<systemProperties>
<systemProperty>
<name>dqs.env</name>
<value>local</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*RunDQSWsTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*RunDQSWsTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
RunDQSWsTest.java 是运行所有 .feature 文件的主文件