Skip to content

Commit 0ffa6ad

Browse files
committed
[8.4.6] - 2023-12-22
1 parent 1a83d41 commit 0ffa6ad

File tree

8 files changed

+32
-12
lines changed

8 files changed

+32
-12
lines changed

.github/workflows/build_maven_compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
distribution: [ 'corretto' ]
24-
java: [ '11', '17' ]
24+
java: [ '11', '17', '21' ]
2525
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
2626
name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check
2727
steps:
@@ -66,4 +66,4 @@ jobs:
6666
distribution: ${{ matrix.distribution }}
6767
java-version: ${{ matrix.java }}
6868
- name: Maven build
69-
run: mvn clean install -P full,coverage
69+
run: mvn clean install -P full,coverage

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [8.4.6] - 2023-12-22
11+
1012
### Changed
1113

14+
- Added java 21 to github action workflow for compatibility check
15+
- fj-bom parent set to 1.5.2
1216
- 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)
1317

18+
### Fixed
19+
20+
- java version helper with major only version (fix for java 21)
21+
1422
## [8.4.5] - 2023-11-12
1523

1624
### Changed

fj-core-jvfs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.fugerit.java</groupId>
1010
<artifactId>fj-lib</artifactId>
11-
<version>8.4.6-SNAPSHOT</version>
11+
<version>8.4.6</version>
1212
</parent>
1313

1414
<name>fj-core-jvfs</name>

fj-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-lib</artifactId>
10-
<version>8.4.6-SNAPSHOT</version>
10+
<version>8.4.6</version>
1111
</parent>
1212

1313
<name>fj-core</name>

fj-core/src/main/java/org/fugerit/java/core/lang/helpers/JavaVersionHelper.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import org.slf4j.Logger;
55
import org.slf4j.LoggerFactory;
66

7+
import lombok.extern.slf4j.Slf4j;
8+
9+
@Slf4j
710
public class JavaVersionHelper {
811

912
private JavaVersionHelper() {}
@@ -18,6 +21,8 @@ private JavaVersionHelper() {}
1821

1922
public static final int MAJOR_VERSION_JAVA_17 = 17;
2023

24+
public static final int MAJOR_VERSION_JAVA_21 = 21;
25+
2126
public static final int MAJOR_VERSION_FJ_CORE_REF = MAJOR_VERSION_JAVA_8; // current reference version for fj-core library!
2227

2328
private static final Logger logger = LoggerFactory.getLogger( JavaVersionHelper.class );
@@ -39,11 +44,17 @@ public static int parseUniversalJavaMajorVersion() {
3944
javaVersion = javaVersion.substring( REMOVE_1_X.length() );
4045
}
4146
int index = javaVersion.indexOf( '.' );
42-
if ( index != -1 ) {
43-
res = Integer.parseInt( javaVersion.substring( 0, index ) );
44-
if ( res < MAJOR_VERSION_FJ_CORE_REF ) {
45-
logger.info( "major version found : '{}' is lower than minimum required -> '{}'", res, MAJOR_VERSION_FJ_CORE_REF );
47+
try {
48+
if ( index != -1 ) {
49+
res = Integer.parseInt( javaVersion.substring( 0, index ) );
50+
} else {
51+
res = Integer.parseInt( javaVersion );
4652
}
53+
} catch (Exception e) {
54+
log.warn( "Error finding java version : "+e, e );
55+
}
56+
if ( res < MAJOR_VERSION_FJ_CORE_REF ) {
57+
logger.info( "major version found : '{}' is lower than minimum required -> '{}'", res, MAJOR_VERSION_FJ_CORE_REF );
4758
}
4859
logger.info( "parseUniversalJavaMajorVersion -> '{}'", res );
4960
}

fj-core/src/test/java/test/org/fugerit/java/core/lang/helpers/TestJavaVersionHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public void test() {
1414
int majorVersion = JavaVersionHelper.parseUniversalJavaMajorVersion();
1515
log.info("major version -> '{}'", majorVersion);
1616
boolean supportedBuildVersion = ( majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_11
17-
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_17 );
17+
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_17
18+
|| majorVersion == JavaVersionHelper.MAJOR_VERSION_JAVA_21 );
1819
Assert.assertTrue( "Wrong java major version : "+majorVersion , supportedBuildVersion );
1920
}
2021

fj-tool/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-lib</artifactId>
10-
<version>8.4.6-SNAPSHOT</version>
10+
<version>8.4.6</version>
1111
</parent>
1212

1313
<name>fj-tool</name>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-bom</artifactId>
10-
<version>1.5.1</version>
10+
<version>1.5.2</version>
1111
<relativePath></relativePath>
1212
</parent>
1313

14-
<version>8.4.6-SNAPSHOT</version>
14+
<version>8.4.6</version>
1515
<packaging>pom</packaging>
1616

1717
<name>fj-lib</name>

0 commit comments

Comments
 (0)