Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure improvements - Migration to Java 11 from Java 8 #368

Open
wants to merge 20 commits into
base: jena4-upgrade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-api</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand All @@ -22,6 +22,37 @@
<build>
<plugins>
<plugin>
This conversation was marked as resolved.
Show resolved Hide resolved
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>echo-properties</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>false</skip>
<target>
<echo message="###################################################################" />
<echo message="Displaying value of '${project.artifactId}' properties" />
<echo message="###################################################################" />
<echo message="[vitro-version] ${vitro-version}" />
<echo message="[vivo-version] ${vivo-version}" />
<echo message="[vivo-dir] ${vivo-dir}" />
<echo message="[project.version] ${project.version}" />
<echo message="[java.vendor.version] ${java.vendor.version}" />
<echo message="[java.version] ${java.version}" />
<echo message="[java.specification.version] ${java.specification.version}" />
<echo message="[maven.compiler.release] ${maven.compiler.release}" />
<echo message="###################################################################" />
<echo message="###################################################################" />
</target>
</configuration>
</execution>
</executions>
</plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -73,7 +104,7 @@
<dependency>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-dependencies</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<type>pom</type>
</dependency>
<dependency>
Expand Down
17 changes: 17 additions & 0 deletions api/src/test/java/compilation/IsNotCompatibleWithJava8.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package compilation;

import static org.junit.Assert.*;

import org.junit.Test;

public class IsNotCompatibleWithJava8 {
/*
* This code segment is compatible with Java 11 and not compatible with java 8. It will abort the compilation if the Java context is version 8
*/
@Test
public void test() {
String value = "This code is compiled in Java 11";
System.out.println(value.isBlank());
}
Comment on lines +11 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@michel-heon michel-heon Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenejac
This class uses a method (isBlank()) which is available only in JAVA 11. In java 8 the compilation sends an incompatibility message on the method.
The stackoverfow proposal is also very good. You just have to locate the right class to implement it. Do you have any suggestion ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a test for that. I would suggest to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is in which scenario someone can run tests using JDK 8, when we are requesting 11 in pom.xml file. It is of course possible, but completely out of VIVO installation/building procedure, should we take care in that case? Anyway, if some test is needed, it shouldn't just print some message, we need assertion (probably in this case assertFalse(value.isBlank()), but not sure what will happen in JDK 1.8 case).


}
4 changes: 2 additions & 2 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-dependencies</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-home</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions installer/home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-installer-home</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-installer</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
4 changes: 1 addition & 3 deletions installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-installer</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Vitro Installer</name>
Expand All @@ -23,8 +23,6 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions installer/webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-installer-webapp</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>war</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-installer</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Vitro</name>
Expand Down Expand Up @@ -61,6 +61,7 @@
<maven-site-plugin.skip>false</maven-site-plugin.skip>
<stagingBase>/</stagingBase>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
</properties>

<modules>
Expand Down Expand Up @@ -255,8 +256,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
Expand Down
6 changes: 3 additions & 3 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-webapp</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<packaging>war</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-api</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>