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

Require Java 8 #91

Merged
merged 1 commit into from
Aug 22, 2021
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Plexus Language
![Build Status](https://github.com/codehaus-plexus/plexus-languages/workflows/GitHub%20CI/badge.svg)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/codehaus-plexus/plexus-languages/GitHub%20CI)

Plexus Languages:

Expand Down
4 changes: 2 additions & 2 deletions plexus-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<name>Plexus Languages :: Java</name>

<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
Expand Down
6 changes: 3 additions & 3 deletions plexus-java/src/site/markdown/locationmanager.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
The plexus-java library is created to have a solution for common activities, so this business logic doesn't have to be maintained at multiple places. The first provided feature was the `LocationManager` to analyze module desciptors and to decide which jars should end up on the modulepath and which on the classpath. The name was based on the [javax.tools.JavaFileManager.Location]. (https://docs.oracle.com/javase/10/docs/api/javax/tools/JavaFileManager.Location.html)

The library requires Java 7 to run, but contains optimized code for Java 9. By requiring Java 7 it was much easier to embed this library in several other projects.
The library requires Java 8 to run, but contains optimized code for Java 9. By requiring Java 8 it was much easier to embed this library in several other projects.

This jar is a multi release jar (aka MRJAR), because it contains 2 implementations for the `BinaryModuleInfoParser`. If the Java runtime is 9 or above, the `java.lang.module.ModuleDescriptor` is used to read the `module-info.class`. If the runtime is Java 7 or Java 8, then ASM is used to read the module descriptor.
This jar is a multi release jar (aka MRJAR), because it contains 2 implementations for the `BinaryModuleInfoParser`. If the Java runtime is 9 or above, the `java.lang.module.ModuleDescriptor` is used to read the `module-info.class`. If the runtime is Java 8, then ASM is used to read the module descriptor.

When extracting the the automatic module name based the of the file, it is a little bit more complex. The result must be precise, so the only way to solve this is by calling Java 9 code, either from the runtime or by calling Java 9 explicitly when provided via `ResolvePathsRequest.setJdkHome`.

Expand All @@ -26,7 +26,7 @@ Additional methods are:

- `setIncludeAllProviders`, in general would only be used at runtime, not during compile or test. In case `uses` is used, all modules with matching `provides` are added as well.

- `setJdkHome`, should point to Java 9 or above in case the runtime of this library is Java 7 or 8
- `setJdkHome`, should point to Java 9 or above in case the runtime of this library is Java 8

- `setMainModuleDescriptor`, which can either be a `module-info.java` or `module-info.class`

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<properties>
<scm.url>scm:git:git@github.com:codehaus-plexus/plexus-languages.git</scm.url>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javaVersion>7</javaVersion>
<javaVersion>8</javaVersion>
<project.build.outputTimestamp>2021-03-27T12:17:24Z</project.build.outputTimestamp>
</properties>

Expand Down