apache / felix-atomos

Apache Felix Atomos
https://felix.apache.org/
Apache License 2.0
38 stars 19 forks source link

Build fails with Java 17 #66

Closed fipro78 closed 5 months ago

fipro78 commented 2 years ago

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.

tjwatson commented 2 years ago

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

jingsx commented 1 year ago

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

rombert commented 1 year ago

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

tjwatson commented 1 year ago

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?

cziegeler commented 1 year ago

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

tjwatson commented 1 year ago

@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

VaginAY commented 5 months ago

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