Skip to content

Commit

Permalink
adds additional multi-module integration test
Browse files Browse the repository at this point in the history
This test requires fix for #40 due to "deleteRelease=false".
  • Loading branch information
tjuerge committed Sep 28, 2019
1 parent 3be13f7 commit b1a086f
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/it/test-multi-module/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# How this works

* The `maven-invoker-plugin` uses it's own `settings.xml` which is merged with the one from `~/.m2/settings.xml`.
* The credentials for deploying too Github are under the `~/.m2/settings.xml`, so as to not having to add them
as sources.
* The `repositoryId` and expected `serverId` in the `~/.m2/settings.xml` file are as follows
```
<repositoryId>jutzig/github-release-plugin</repositoryId>
<serverId>jutzig/github-release-plugin</serverId>
```
56 changes: 56 additions & 0 deletions src/it/test-multi-module/child1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<project>

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.jutzig</groupId>
<artifactId>test-parent</artifactId>
<version>@project.version@</version>
</parent>
<artifactId>child1</artifactId>

<build>
<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>

<configuration>
<description>Test artifact ${project.version}.</description>
<releaseName>${project.version}</releaseName>
<tag>${project.version}</tag>

<overwriteArtifact>true</overwriteArtifact>
<serverId>jutzig/github-release-plugin</serverId>
<deleteRelease>false</deleteRelease>

<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>${project.artifactId}*.jar</include>
</includes>
</fileSet>
</fileSets>
</configuration>

<executions>
<execution>
<phase>package</phase>
<goals>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.jutzig.maven.test;

public class HelloWorld
{

public static void main(String[] args)
{
System.out.println("Hello, world!");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package de.jutzig.maven.test;

import java.io.IOException;
import java.util.Properties;

import org.junit.Assert;
import org.junit.Test;

public class HelloWorldTest
{

@Test
public void connectionTest() throws IOException
{
}

}
56 changes: 56 additions & 0 deletions src/it/test-multi-module/child2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<project>

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.jutzig</groupId>
<artifactId>test-parent</artifactId>
<version>@project.version@</version>
</parent>
<artifactId>child2</artifactId>

<build>
<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>

<configuration>
<description>Test artifact ${project.version}.</description>
<releaseName>${project.version}</releaseName>
<tag>${project.version}</tag>

<overwriteArtifact>false</overwriteArtifact>
<serverId>jutzig/github-release-plugin</serverId>
<deleteRelease>false</deleteRelease>

<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>${project.artifactId}*.jar</include>
</includes>
</fileSet>
</fileSets>
</configuration>

<executions>
<execution>
<phase>package</phase>
<goals>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.jutzig.maven.test;

public class HelloWorld
{

public static void main(String[] args)
{
System.out.println("Hello, world!");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package de.jutzig.maven.test;

import java.io.IOException;
import java.util.Properties;

import org.junit.Assert;
import org.junit.Test;

public class HelloWorldTest
{

@Test
public void connectionTest() throws IOException
{
}

}
1 change: 1 addition & 0 deletions src/it/test-multi-module/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=deploy -Dmaven.deploy.skip=true -e -X
30 changes: 30 additions & 0 deletions src/it/test-multi-module/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<project>

<modelVersion>4.0.0</modelVersion>

<groupId>de.jutzig</groupId>
<artifactId>test-parent</artifactId>
<version>@project.version@</version>
<packaging>pom</packaging>

<scm>
<connection>scm:git:[email protected]:jutzig/github-release-plugin.git</connection>
<developerConnection>scm:git:[email protected]:jutzig/github-release-plugin.git</developerConnection>
<url>https:/jutzig/github-release-plugin/tree/${project.scm.tag}</url>
<tag>master</tag>
</scm>

<modules>
<module>child1</module>
<module>child2</module>
</modules>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
2 changes: 2 additions & 0 deletions src/it/test-multi-module/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// TODO: Add a proper check, but, basically, if the invoker build fails, that would be enough of a failure.
return true

0 comments on commit b1a086f

Please sign in to comment.