Skip to content

Commit e422a12

Browse files
committed
Clarify skip message and add an it-test for skip
1 parent d54aa05 commit e422a12

File tree

6 files changed

+76
-1
lines changed

6 files changed

+76
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoker.goals=clean verify site -e -ntp

src/it/test_skip_configured/pom.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>it.scoverage-maven-plugin</groupId>
9+
<artifactId>integration_tests_parent</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
<relativePath>../integration_tests_parent/pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>test_skip_configured</artifactId>
15+
<version>1.0-SNAPSHOT</version>
16+
<packaging>jar</packaging>
17+
<name>Test Scoverage is Skipped when configured</name>
18+
<description>Test Scoverage is Skipped when configured</description>
19+
20+
<build>
21+
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-compiler-plugin</artifactId>
25+
</plugin>
26+
<plugin>
27+
<groupId>net.alchim31.maven</groupId>
28+
<artifactId>scala-maven-plugin</artifactId>
29+
</plugin>
30+
<plugin>
31+
<groupId>org.scalatest</groupId>
32+
<artifactId>scalatest-maven-plugin</artifactId>
33+
</plugin>
34+
<plugin>
35+
<groupId>@project.groupId@</groupId>
36+
<artifactId>@project.artifactId@</artifactId>
37+
<configuration>
38+
<skip>true</skip>
39+
</configuration>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package service
2+
3+
object HelloServiceScala {
4+
def hello = { "Hello" }
5+
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package service
2+
3+
import org.scalatest.wordspec.AnyWordSpec
4+
5+
class HelloServiceScalaTest extends AnyWordSpec {
6+
7+
"HelloService" should {
8+
"say hello" in {
9+
assert(HelloServiceScala.hello == "Hello")
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
try {
2+
3+
def logFile = new File(basedir, "build.log")
4+
def lines = logFile.readLines()
5+
assert lines.contains("[INFO] Skipping Scoverage execution as configured")
6+
assert !lines.contains("Generating \"SCoverage\" report")
7+
8+
return true
9+
10+
} catch (Throwable e) {
11+
e.printStackTrace()
12+
return false
13+
}

src/main/java/org/scoverage/plugin/SCoveragePreCompileMojo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void execute() throws MojoExecutionException
198198

199199
if ( skip )
200200
{
201-
getLog().info( "Skipping Scoverage execution" );
201+
getLog().info( "Skipping Scoverage execution as configured" );
202202

203203
Properties projectProperties = project.getProperties();
204204

0 commit comments

Comments
 (0)