From 9203b010d250a7631e66e465039c95f618f33b70 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Tue, 4 Aug 2020 11:16:25 +0100 Subject: [PATCH] Allow building on Java 11 --- junit.spec | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/junit.spec b/junit.spec index d6c25c3..cae2b2e 100644 --- a/junit.spec +++ b/junit.spec @@ -1,13 +1,13 @@ Name: junit Epoch: 1 Version: 4.12 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ BuildArch: noarch -# ./clean-tarball.sh %{version} +# ./clean-tarball.sh %%{version} Source0: %{name}-%{version}-clean.tar.gz Source3: create-tarball.sh @@ -67,25 +67,44 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr " +# Use compiler release flag when building on JDK >8 for correct cross-compiling +%pom_xpath_inject pom:profiles " + + jdk-release-flag + + [9,) + + + \${jdkVersion} + + " + +# Ignore test that breaks on Java 11 due to unexpected extra annotations in the JDK standard library +sed -i -e '/providesAnnotatedMethodsSortedByName/i@Ignore' src/test/java/org/junit/runners/model/TestClassTest.java + %mvn_file : %{name} %build -%mvn_build +%mvn_build -- -DjdkVersion=8 %install %mvn_install %files -f .mfiles -%doc LICENSE-junit.txt README.md +%license LICENSE-junit.txt +%doc README.md %files javadoc -f .mfiles-javadoc -%doc LICENSE-junit.txt +%license LICENSE-junit.txt %files manual -%doc LICENSE-junit.txt +%license LICENSE-junit.txt %doc doc/* %changelog +* Tue Aug 04 2020 Mat Booth - 1:4.12-17 +- Allow building on Java 11 + * Sat Aug 01 2020 Fedora Release Engineering - 1:4.12-16 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild