Skip to content

would it be considerable to add Multi-Release JAR mechanism? virtual thread seems helpful in this repo.(at least helpful for bf) #1537

@XenoAmess

Description

@XenoAmess

seems there be some thread executor in this repo be handling IO related things, looks like they should benifit from changing to virtual thread(loom) when using on newer jdk (19+)

New feature, improvement proposal

  1. add something like
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version> <!-- Use a version that supports multi-release -->
        <executions>
            <execution>
                <id>default-compile</id>
                <goals>
                    <goal>compile</goal>
                </goals>
                <configuration>
                    <release>8</release> <!-- Base version -->
                </configuration>
            </execution>
            <execution>
                <id>java9-compile</id>
                <goals>
                    <goal>compile</goal>
                </goals>
                <configuration>
                    <release>19</release>
                    <source>19</source>
                    <target>19</target>
                    <multiReleaseOutput>true</multiReleaseOutput>
                    <outputDirectory>${project.build.outputDirectory}/META-INF/versions/9</outputDirectory>
                    <includes>
                        <include>path/to/java19/specific/classes/**</include>
                    </includes>
                </configuration>
            </execution>
            <!-- Add more executions for other Java versions as needed -->
        </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
            <archive>
                <manifestEntries>
                    <Multi-Release>true</Multi-Release>
                </manifestEntries>
            </archive>
        </configuration>
    </plugin>

then modify the jdk19 version of that classes
then make ci use jdk21 to compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions