Skip to content

Commit

Permalink
[#148] enable builds with higher jdks by setting mockito versions via…
Browse files Browse the repository at this point in the history
… java version related profiles
  • Loading branch information
tobiasstamann committed Apr 11, 2024
1 parent e7dba0b commit f79ba2a
Showing 1 changed file with 106 additions and 21 deletions.
127 changes: 106 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@

<inceptionYear>2017</inceptionYear>

<prerequisites>
<maven>3.6.0</maven>
</prerequisites>


<issueManagement>
<url>https://github.com/toolisticon/aptk/issues</url>
<system>GitHub Issues</system>
Expand Down Expand Up @@ -92,7 +87,8 @@
<!-- versions of test dependencies -->
<junit.version>4.13.2</junit.version>
<hamcrest.version>2.2</hamcrest.version>
<mockito.version>4.3.1</mockito.version>
<mockito.version>4.11.0</mockito.version>
<mockito_jdk11.version>5.11.0</mockito_jdk11.version>

<!-- sonatype url-->
<sonatype-oss-dist-mgmt-snapshots-url>https://oss.sonatype.org/content/repositories/snapshots/
Expand Down Expand Up @@ -202,18 +198,6 @@
<pluginManagement>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${maven-build-helper-plugin.version}</version>
</plugin>

<!-- sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>

<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
Expand Down Expand Up @@ -559,6 +543,19 @@
<jdk>[1.8,9)</jdk>
</activation>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

</dependencyManagement>

<build>

Expand All @@ -573,7 +570,7 @@
<executions>

<execution>
<id>check_java17</id>
<id>check_java8</id>

<phase>test</phase>

Expand Down Expand Up @@ -611,9 +608,22 @@
<profile>
<id>jdkgreaterthan8</id>
<activation>
<jdk>[9,99)</jdk>
<jdk>[9,11)</jdk>
</activation>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

</dependencyManagement>

<build>

Expand Down Expand Up @@ -671,6 +681,82 @@
</profile>


<profile>
<id>jdkgreaterthan11</id>
<activation>
<jdk>[11,99)</jdk>
</activation>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito_jdk11.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

</dependencyManagement>

<build>


<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.18</version>

<configuration>
<ignores>
<ignore>com.sun.source.util.Trees</ignore>
<ignore>com.sun.source.tree.*</ignore>
</ignores>

</configuration>

<executions>

<execution>
<id>check_java18</id>

<phase>test</phase>

<goals>
<goal>check</goal>
</goals>

<configuration>
<excludeDependencies>
<excludeDependency>io.toolisticon.cute:*</excludeDependency>
</excludeDependencies>

<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>

</configuration>

</execution>

</executions>


</plugin>

</plugins>


</build>
</profile>


</profiles>

<distributionManagement>
Expand Down Expand Up @@ -707,7 +793,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

Expand Down

0 comments on commit f79ba2a

Please sign in to comment.