Skip to content

Commit

Permalink
[8.4.6] - 2023-12-22
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Dec 22, 2023
1 parent 1a83d41 commit 0ffa6ad
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_maven_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
distribution: [ 'corretto' ]
java: [ '11', '17' ]
java: [ '11', '17', '21' ]
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check
steps:
Expand Down Expand Up @@ -66,4 +66,4 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Maven build
run: mvn clean install -P full,coverage
run: mvn clean install -P full,coverage
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [8.4.6] - 2023-12-22

### Changed

- Added java 21 to github action workflow for compatibility check
- fj-bom parent set to 1.5.2
- fj-bom parent set to 1.5.1, [fix lombok-maven-plugin compatibility with java 21](https://github.com/fugerit-org/fj-bom/blob/main/CHANGELOG.md#151---2023-12-22)

### Fixed

- java version helper with major only version (fix for java 21)

## [8.4.5] - 2023-11-12

### Changed
Expand Down
2 changes: 1 addition & 1 deletion fj-core-jvfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-lib</artifactId>
<version>8.4.6-SNAPSHOT</version>
<version>8.4.6</version>
</parent>

<name>fj-core-jvfs</name>
Expand Down
2 changes: 1 addition & 1 deletion fj-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-lib</artifactId>
<version>8.4.6-SNAPSHOT</version>
<version>8.4.6</version>
</parent>

<name>fj-core</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class JavaVersionHelper {

private JavaVersionHelper() {}
Expand All @@ -18,6 +21,8 @@ private JavaVersionHelper() {}

public static final int MAJOR_VERSION_JAVA_17 = 17;

public static final int MAJOR_VERSION_JAVA_21 = 21;

public static final int MAJOR_VERSION_FJ_CORE_REF = MAJOR_VERSION_JAVA_8; // current reference version for fj-core library!

private static final Logger logger = LoggerFactory.getLogger( JavaVersionHelper.class );
Expand All @@ -39,11 +44,17 @@ public static int parseUniversalJavaMajorVersion() {
javaVersion = javaVersion.substring( REMOVE_1_X.length() );
}
int index = javaVersion.indexOf( '.' );
if ( index != -1 ) {
res = Integer.parseInt( javaVersion.substring( 0, index ) );
if ( res < MAJOR_VERSION_FJ_CORE_REF ) {
logger.info( "major version found : '{}' is lower than minimum required -> '{}'", res, MAJOR_VERSION_FJ_CORE_REF );
try {
if ( index != -1 ) {
res = Integer.parseInt( javaVersion.substring( 0, index ) );
} else {
res = Integer.parseInt( javaVersion );
}
} catch (Exception e) {
log.warn( "Error finding java version : "+e, e );
}
if ( res < MAJOR_VERSION_FJ_CORE_REF ) {
logger.info( "major version found : '{}' is lower than minimum required -> '{}'", res, MAJOR_VERSION_FJ_CORE_REF );
}
logger.info( "parseUniversalJavaMajorVersion -> '{}'", res );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public void test() {
int majorVersion = JavaVersionHelper.parseUniversalJavaMajorVersion();
log.info("major version -> '{}'", majorVersion);
boolean supportedBuildVersion = ( majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_11
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_17 );
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_17
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_21 );
Assert.assertTrue( "Wrong java major version : "+majorVersion , supportedBuildVersion );
}

Expand Down
2 changes: 1 addition & 1 deletion fj-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-lib</artifactId>
<version>8.4.6-SNAPSHOT</version>
<version>8.4.6</version>
</parent>

<name>fj-tool</name>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-bom</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<relativePath></relativePath>
</parent>

<version>8.4.6-SNAPSHOT</version>
<version>8.4.6</version>
<packaging>pom</packaging>

<name>fj-lib</name>
Expand Down

0 comments on commit 0ffa6ad

Please sign in to comment.