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

Conversation

michel-heon
Copy link
Member

See also vivo-project/VIVO#3836 for documentation
@chenejac

java 8. It will abort the compilation if the Java context is version 8
                <configuration>
                    <source>JAVA_RELEASE</source>
                    <target>JAVA_RELEASE</target>
                </configuration>
by
<maven.compiler.release>JAVA_RELEASE</maven.compiler.release> in top pom
file
@chenejac chenejac changed the base branch from infrastructure-improvements to main February 23, 2023 20:38
@chenejac chenejac requested review from litvinovg and a user February 23, 2023 20:44
Copy link
Contributor

@litvinovg litvinovg left a comment

Choose a reason for hiding this comment

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

@michel-heon please remove Vitro version changes from pom files. It is not related to the PR scope and can cause merge conflicts in future.

@michel-heon
Copy link
Member Author

@litvinovg The return to 1.13.1 is done.... but this version corresponds to the previous sprint and is not representative of the evolution of development. This version misalignment may lead to misunderstandings about the evolution of the development.

Copy link
Contributor

@litvinovg litvinovg left a comment

Choose a reason for hiding this comment

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

I decided to try it out on some OS where Java 8 was installed by default. I tried Centos 7.
But the response I received after building it with Java 8 was confusing. It wasn't about Java requirement, it was about new dependency on maven-antrun-plugin that is not provided with default (3.0.5) maven version on Centos 7.
[INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.1.0:run (echo-properties) on project vitro-api: The plugin org.apache.maven.plugins:maven-antrun-plugin:3.1.0 requires Maven version 3.2.5 -> [Help 1]
So I had to install new version manually and finally got error that Java 11 is required.
Adding new dependency (maven-antrun-plugin) at this point doesn't look like good to me as it hides the real problem (Java version requirement).
Also I don't think there is a sense to have the test as it is already specified by maven compiler release setting.
So I suggest to open an issue about properties display in and discuss it there.
For the issue this ticket should resolve I suggest removing maven-antrun-plugin and the test.

fixed message printing bugs on previous version
@ghost ghost linked an issue Feb 28, 2023 that may be closed by this pull request
installer/pom.xml Outdated Show resolved Hide resolved
api/pom.xml Outdated Show resolved Hide resolved
Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

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

@michel-heon please check my suggestions/comments

api/pom.xml Outdated Show resolved Hide resolved
Comment on lines +11 to +15
@Test
public void test() {
String value = "This code is compiled in Java 11";
System.out.println(value.isBlank());
}
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).

No comment

Co-authored-by: Dragan Ivanovic <[email protected]>
@chenejac chenejac changed the base branch from main to jena4-upgrade March 8, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration to Java 11 from Java 8
3 participants