Skip to content

Commit 7482fdb

Browse files
authored
Merge pull request #323 from stefanseifert/feature/issue64-parent-snapshot-check
#64 Check for SNAPSHOT dependency in parent project definition
2 parents c0b13b5 + d2dfaeb commit 7482fdb

File tree

13 files changed

+141
-2
lines changed

13 files changed

+141
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
<plugins>
192192
<plugin>
193193
<artifactId>maven-invoker-plugin</artifactId>
194-
<version>3.2.0</version>
194+
<version>3.2.2</version>
195195
<configuration>
196196
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
197197
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build.log
2+
expected-pom.xml
3+
invoker.properties
4+
init.bsh
5+
verify.bsh
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import org.apache.commons.io.FileUtils;
2+
3+
try {
4+
new File(basedir, "gitignorefile").renameTo(new File(basedir, ".gitignore"));
5+
6+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " init");
7+
p.waitFor();
8+
9+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " config user.email '[email protected]'");
10+
p.waitFor();
11+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " config user.name 'a'");
12+
p.waitFor();
13+
14+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " add .");
15+
p.waitFor();
16+
17+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " commit -m init");
18+
p.waitFor();
19+
20+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " checkout -b develop");
21+
p.waitFor();
22+
} catch (Exception e) {
23+
e.printStackTrace();
24+
return false;
25+
}
26+
return true;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:release-start -B
2+
3+
invoker.description=Non-interactive simple release-start: Failure due to SNAPSHOT dependency
4+
5+
invoker.buildResult=failure
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.amashchenko.maven.plugin</groupId>
4+
<artifactId>gitflow-maven-test</artifactId>
5+
<packaging>pom</packaging>
6+
<version>0.0.3-SNAPSHOT</version>
7+
8+
<dependencies>
9+
<dependency>
10+
<groupId>localhost</groupId>
11+
<artifactId>dummy-api</artifactId>
12+
<version>1.1-SNAPSHOT</version>
13+
<scope>compile</scope>
14+
</dependency>
15+
</dependencies>
16+
17+
</project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
File file = new File( basedir, "build.log" );
2+
assert file.exists();
3+
4+
String text = file.getText("utf-8");
5+
6+
// ensure build fails due to SNAPSHOT dependencies
7+
assert text.contains("There is some SNAPSHOT dependencies in the project,")
8+
9+
return true;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>localhost</groupId>
6+
<artifactId>dummy-parent</artifactId>
7+
<version>1.1-SNAPSHOT</version>
8+
<packaging>pom</packaging>
9+
10+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build.log
2+
expected-pom.xml
3+
invoker.properties
4+
init.bsh
5+
verify.bsh
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import org.apache.commons.io.FileUtils;
2+
3+
try {
4+
new File(basedir, "gitignorefile").renameTo(new File(basedir, ".gitignore"));
5+
6+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " init");
7+
p.waitFor();
8+
9+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " config user.email '[email protected]'");
10+
p.waitFor();
11+
Process p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " config user.name 'a'");
12+
p.waitFor();
13+
14+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " add .");
15+
p.waitFor();
16+
17+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " commit -m init");
18+
p.waitFor();
19+
20+
p = Runtime.getRuntime().exec("git --git-dir=" + basedir + "/.git --work-tree=" + basedir + " checkout -b develop");
21+
p.waitFor();
22+
} catch (Exception e) {
23+
e.printStackTrace();
24+
return false;
25+
}
26+
return true;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:release-start -B
2+
3+
invoker.description=Non-interactive simple release-start: Failure due to SNAPSHOT parent dependency
4+
5+
invoker.buildResult=failure

0 commit comments

Comments
 (0)