Skip to content

Commit

Permalink
Merge pull request #55 from andreaTP/use-mvn-invoker
Browse files Browse the repository at this point in the history
Use Maven Invoker for the Maven plugin tests
  • Loading branch information
EricWittmann authored Sep 13, 2022
2 parents 2a6076a + 1021b5a commit aa4b8a6
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/target/
/core/target/
/cli/target/
/maven-plugin-tests/target/
.generated
.ts
.js
Expand Down
49 changes: 45 additions & 4 deletions maven-plugin-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,50 @@
<artifactId>apicurio-codegen-maven-plugin-tests</artifactId>
<packaging>pom</packaging>

<modules>
<module>basic-codegen-test</module>
<module>widget-api-test</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<cloneClean>true</cloneClean>
<settingsFile>src/it/settings.xml</settingsFile>
<postBuildHookScript>verify</postBuildHookScript>
<addTestClassPath>true</addTestClassPath>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
<invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
<scriptVariables>
<version>${project.version}</version>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
</scriptVariables>
</configuration>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=test
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,44 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-maven-plugin-tests</artifactId>
<version>1.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>basic-codegen-test</artifactId>
<groupId>io.apicurio</groupId>
<version>0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${version.com.fasterxml.jackson}</version>
<version>@version.com.fasterxml.jackson@</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${version.com.fasterxml.jackson}</version>
<version>@version.com.fasterxml.jackson@</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${version.com.fasterxml.jackson}</version>
<version>@version.com.fasterxml.jackson@</version>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<version>${version.org.jboss.spec.javax.ws.jboss-jaxrs-api_2.1_spec}</version>
<version>@version.org.jboss.spec.javax.ws.jboss-jaxrs-api_2.1_spec@</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<version>@version.junit@</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -49,7 +50,7 @@
<plugin>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
<version>@project.version@</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand Down
35 changes: 35 additions & 0 deletions maven-plugin-tests/src/it/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=test
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-maven-plugin-tests</artifactId>
<version>1.0.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>widget-api-test</artifactId>

<groupId>io.apicurio</groupId>
<version>0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -71,7 +69,7 @@
<plugin>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
<version>@project.version@</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand Down

0 comments on commit aa4b8a6

Please sign in to comment.