felix-atomos icon indicating copy to clipboard operation
felix-atomos copied to clipboard

Build fails with Java 17

Open fipro78 opened this issue 3 years ago • 6 comments

If I try to build atomos locally using a Java 17, the build fails with this error:

[ERROR] Failed to execute goal org.codehaus.mojo:ianal-maven-plugin:1.0-alpha-1:verify-legal-files (default) on project osgi.core: Execution default of goal org.codehaus.mojo:ianal-maven-plugin:1.0-alpha-1:verify-legal-files failed: Unable to make private java.io.File(java.lang.String,java.io.File) accessible: module java.base does not "opens java.io" to unnamed module @627d5f99

Not sure if and how this can be fixed. Running the build using Java 11 works.

fipro78 avatar Sep 22 '22 12:09 fipro78

I believe this is because of the felix-dev parent pom we use that has:

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>ianal-maven-plugin</artifactId>
                    <version>1.0-alpha-1</version>
                </plugin>

That plugin looks completely unmantained. No real release, only this alpha-1 from 2008! @karlpauls Why does the felix parent pom use this unmaintained plugin? https://github.com/apache/felix-dev/blob/master/pom/pom.xml

tjwatson avatar Sep 22 '22 15:09 tjwatson

I am facing same issue. Is there a fix available for this issue ?

jingsx avatar Nov 10 '23 04:11 jingsx

In Sling we replaced that plugin with the tools-maven-plugin from Geronimo, see https://github.com/apache/sling-parent/pull/21

rombert avatar Nov 10 '23 08:11 rombert

In Sling we replaced that plugin with the tools-maven-plugin from Geronimo, see apache/sling-parent#21

Seems the felix parent also has been updated, but no release of it to include the fix:

https://github.com/apache/felix-dev/blob/a3d7175628b93e07c88945c53dd39405bf81f6da/pom/pom.xml#L225-L239

@cziegeler any plans to release the updated felix-parent pom?

tjwatson avatar Nov 10 '23 19:11 tjwatson

@tjwatson I wanted to wait until someone tried it with java 17 to see whether it works

cziegeler avatar Nov 11 '23 09:11 cziegeler

@tjwatson I wanted to wait until someone tried it with java 17 to see whether it works

The 8-SNAPSHOT with the updated felix parent works for me on Java 17. That is after remembering that felix-atomos has two references to the felix parent:

https://github.com/apache/felix-atomos/blob/41e89d79d59a68f7223469797afae4be2251c29b/pom.xml#L23-L28 https://github.com/apache/felix-atomos/blob/41e89d79d59a68f7223469797afae4be2251c29b/atomos-parent/pom.xml#L23-L28

tjwatson avatar Nov 14 '23 15:11 tjwatson

Hello. Here is my patch for project compilation

Check with bellsoft java and actual graalvm : graalvm-community-openjdk-17.0.9+9.1 graalvm-community-openjdk-21.0.2+13.1

Example with atomos_lib is working good.

java17_atomos.zip

VaginAY avatar Jun 09 '24 10:06 VaginAY