Skip to content

Commit ad1076e

Browse files
Add skipIfMissing flag (#187)
* Add skipIfMissing flag - build-helper:add-source - build-helper:add-test-source - build-helper:add-resource - build-helper:add-test-resource Co-authored-by: Slawomir Jaranowski <s.jaranowski@gmail.com>
1 parent faab936 commit ad1076e

17 files changed

Lines changed: 254 additions & 7 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoker.goals = -X generate-sources
2+
invoker.buildResult = success
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>build-helper</groupId>
6+
<artifactId>integration-test</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<groupId>@project.groupId@</groupId>
13+
<artifactId>@project.artifactId@</artifactId>
14+
<version>@project.version@</version>
15+
<executions>
16+
<execution>
17+
<id>integration-test</id>
18+
<phase>generate-sources</phase>
19+
<goals>
20+
<goal>add-resource</goal>
21+
</goals>
22+
<configuration>
23+
<resources>
24+
<resource>
25+
<directory>${project.basedir}/not-existing</directory>
26+
<targetPath>does-not-matter</targetPath>
27+
</resource>
28+
</resources>
29+
<skipAddResourceIfMissing>true</skipAddResourceIfMissing>
30+
</configuration>
31+
</execution>
32+
</executions>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
</project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
File file = new File( basedir, "build.log" );
2+
assert file.exists();
3+
4+
String text = file.getText("utf-8");
5+
6+
assert text.contains("skipAddResourceIfMissing = true");
7+
assert text.contains("Skipping directory: ");
8+
assert text.contains("not-existing, because it does not exist");
9+
10+
return true;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoker.goals = -X generate-sources
2+
invoker.buildResult = success
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>build-helper</groupId>
6+
<artifactId>integration-test</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<groupId>@project.groupId@</groupId>
13+
<artifactId>@project.artifactId@</artifactId>
14+
<version>@project.version@</version>
15+
<executions>
16+
<execution>
17+
<id>integration-test</id>
18+
<phase>generate-sources</phase>
19+
<goals>
20+
<goal>add-source</goal>
21+
</goals>
22+
<configuration>
23+
<sources>
24+
<source>${project.basedir}/not-existing</source>
25+
</sources>
26+
<skipAddSourceIfMissing>true</skipAddSourceIfMissing>
27+
</configuration>
28+
</execution>
29+
</executions>
30+
</plugin>
31+
</plugins>
32+
</build>
33+
</project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
File file = new File( basedir, "build.log" );
2+
assert file.exists();
3+
4+
String text = file.getText("utf-8");
5+
6+
assert text.contains("skipAddSourceIfMissing = true");
7+
assert text.contains("Skipping directory: ");
8+
assert text.contains("not-existing, because it does not exist.");
9+
10+
return true;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoker.goals = -X generate-sources
2+
invoker.buildResult = success
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>build-helper</groupId>
6+
<artifactId>integration-test</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<groupId>@project.groupId@</groupId>
13+
<artifactId>@project.artifactId@</artifactId>
14+
<version>@project.version@</version>
15+
<executions>
16+
<execution>
17+
<id>integration-test</id>
18+
<phase>generate-sources</phase>
19+
<goals>
20+
<goal>add-test-resource</goal>
21+
</goals>
22+
<configuration>
23+
<resources>
24+
<resource>
25+
<directory>${project.basedir}/not-existing</directory>
26+
<targetPath>does-not-matter</targetPath>
27+
</resource>
28+
</resources>
29+
<skipAddTestResourceIfMissing>true</skipAddTestResourceIfMissing>
30+
</configuration>
31+
</execution>
32+
</executions>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
</project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
File file = new File( basedir, "build.log" );
2+
assert file.exists();
3+
4+
String text = file.getText("utf-8");
5+
6+
assert text.contains("skipAddTestResourceIfMissing = true");
7+
assert text.contains("Skipping directory: ");
8+
assert text.contains("not-existing, because it does not exist.");
9+
10+
return true;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoker.goals = -X generate-sources
2+
invoker.buildResult = success

0 commit comments

Comments
 (0)