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 all 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
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: 1 addition & 3 deletions installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Expand Up @@ -76,7 +74,7 @@
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion installer/webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
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