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

improve java 17 build support #9850

Open
landryb opened this issue Dec 29, 2023 · 2 comments
Open

improve java 17 build support #9850

landryb opened this issue Dec 29, 2023 · 2 comments

Comments

@landryb
Copy link
Collaborator

landryb commented Dec 29, 2023

Description

as of now mapstore 2 doesnt build with java 17.

a first step is to use a more recent version of the maven-war plugin, using 3.4.0 instead of 2.1.1.

this allows a build with -DskipTests to succeed.

the tests themselves fail to build with the same failure:

java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.creation.jmock.ClassImposterizer$3
        at org.mockito.internal.creation.jmock.ClassImposterizer.createProxyClass(ClassImposterizer.java:85)
        at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:62)
        at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56)
        at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23)
        at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
        at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
        at org.mockito.Mockito.mock(Mockito.java:1243)
        at org.mockito.Mockito.mock(Mockito.java:1120)
        at it.geosolutions.mapstore.LoadAssetControllerTest.testLoadPngAsset(LoadAssetControllerTest.java:152)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)

this has probably something to do with an update of the mockito framework ?

@landryb
Copy link
Collaborator Author

landryb commented Dec 29, 2023

updating mockito to 4.0.0 (cf 4c3c2b8) seems to fix java 17 compat, here mvn clean install succeeds now.

@landryb
Copy link
Collaborator Author

landryb commented Dec 29, 2023

cf #6935 for a requirements update if java 17 is deemed acceptable. i know mapstore runs fine with java17, and #9851 might allow to build with java17.

landryb added a commit to landryb/MapStore2 that referenced this issue May 14, 2024
update:
- mockito-core to 4.0.0
- maven-war-plugin to 3.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant