combatibility with Java 9+, Tested with Java 11; JAXB library v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 13 Sep 2020 12:01:35 +0200
branchv_0
changeset 253d8442b266ca8
parent 252 a9d4a8d5c57f
child 254 c4b901ff0703
combatibility with Java 9+, Tested with Java 11; JAXB library
distributions/debian/build.sh
java/sql-dk/pom.xml
scripts/sql-dk.sh
     1.1 --- a/distributions/debian/build.sh	Sat Jul 25 17:25:19 2020 +0200
     1.2 +++ b/distributions/debian/build.sh	Sun Sep 13 12:01:35 2020 +0200
     1.3 @@ -50,7 +50,7 @@
     1.4  Package: sql-dk
     1.5  Version: $VERSION
     1.6  Maintainer: $NAME
     1.7 -Depends: java7-runtime-headless | java7-runtime | java8-runtime-headless | java8-runtime
     1.8 +Depends: default-jre-headless (>= 2:1.8) | java8-runtime-headless, jaxb
     1.9  Suggests: libpostgresql-jdbc-java,libmysql-java
    1.10  Copyright: $COPYRIGHT_FILE
    1.11  Extra-Files: config.xsd, config.rnc, config.xsl
     2.1 --- a/java/sql-dk/pom.xml	Sat Jul 25 17:25:19 2020 +0200
     2.2 +++ b/java/sql-dk/pom.xml	Sun Sep 13 12:01:35 2020 +0200
     2.3 @@ -15,6 +15,17 @@
     2.4  	
     2.5  	<dependencies>
     2.6  		<dependency>
     2.7 +			<groupId>jakarta.xml.bind</groupId>
     2.8 +			<artifactId>jakarta.xml.bind-api</artifactId>
     2.9 +			<version>2.3.3</version>
    2.10 +		</dependency>
    2.11 +		<dependency>
    2.12 +			<groupId>com.sun.xml.bind</groupId>
    2.13 +			<artifactId>jaxb-impl</artifactId>
    2.14 +			<version>2.3.3</version>
    2.15 +			<scope>runtime</scope>
    2.16 +		</dependency>
    2.17 +		<dependency>
    2.18  			<groupId>org.junit.jupiter</groupId>
    2.19  			<artifactId>junit-jupiter-engine</artifactId>
    2.20  			<version>${junit.version}</version>
    2.21 @@ -86,6 +97,22 @@
    2.22  					</dependency>
    2.23  				</dependencies>
    2.24  			</plugin>
    2.25 +			<plugin>
    2.26 +				<artifactId>maven-dependency-plugin</artifactId>
    2.27 +				<version>3.1.1</version>
    2.28 +				<executions>
    2.29 +					<execution>
    2.30 +						<phase>process-sources</phase>
    2.31 +						<goals>
    2.32 +							<goal>copy-dependencies</goal>
    2.33 +						</goals>
    2.34 +						<configuration>
    2.35 +							<outputDirectory>${project.build.directory}/lib</outputDirectory>
    2.36 +							<includeScope>runtime</includeScope>
    2.37 +						</configuration>
    2.38 +					</execution>
    2.39 +				</executions>
    2.40 +			</plugin>
    2.41  		</plugins>
    2.42  	</build>
    2.43  	
     3.1 --- a/scripts/sql-dk.sh	Sat Jul 25 17:25:19 2020 +0200
     3.2 +++ b/scripts/sql-dk.sh	Sun Sep 13 12:01:35 2020 +0200
     3.3 @@ -18,6 +18,24 @@
     3.4  	"/usr/share/java/mysql.jar"
     3.5  );
     3.6  
     3.7 +# Standard libraries
     3.8 +[ -n "$STANDARD_LIB" ] || STANDARD_LIB=(
     3.9 +	"/usr/share/java/jaxb-api.jar"
    3.10 +	"/usr/share/java/jaxb-runtime.jar"
    3.11 +);
    3.12 +# JAXB library is needed since Java 9 (up to Java 8 it was part of the JRE).
    3.13 +# By default, we use JARs from the distribution.
    3.14 +# Some distributions might contain older versions of the JAXB library (2.3.0)
    3.15 +# that work but generate following waringns:
    3.16 +#   WARNING: An illegal reflective access operation has occurred
    3.17 +#   WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/usr/share/java/jaxb-runtime.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
    3.18 +#   WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
    3.19 +#   WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    3.20 +#   WARNING: All illegal access operations will be denied in a future release
    3.21 +# In order to get rid of them, the user can use newer JARs from Maven that are copied into the java/sql-dk/target/lib/ directory during build.
    3.22 +# This is done by adding them in the STANDARD_LIB variable in his environment.sh file.
    3.23 +
    3.24 +
    3.25  # Additional JDBC drivers might be specified in CUSTOM_JDBC array
    3.26  # Plugins (formatters etc.) might be specified in PLUGINS array
    3.27  
    3.28 @@ -26,7 +44,7 @@
    3.29  
    3.30  CLASS_PATH="$JAR";
    3.31  
    3.32 -for e in "${STANDARD_JDBC[@]}" "${CUSTOM_JDBC[@]}" "${PLUGINS[@]}"; do
    3.33 +for e in "${CUSTOM_JDBC[@]}" "${PLUGINS[@]}" "${STANDARD_JDBC[@]}" "${STANDARD_LIB[@]}"; do
    3.34  	CLASS_PATH="$CLASS_PATH:$e";
    3.35  done
    3.36