Hipparchus-Math / hipparchus

An efficient, general-purpose mathematics components library in the Java programming language
Apache License 2.0
139 stars 41 forks source link

Maven Surefire Plugin Missing in pom.xml #231

Closed SergyD closed 1 year ago

SergyD commented 1 year ago

I tried to build Hipparchus from scratch using mvn install and I had to manually add the surefire to the pom.xml plugin in order to build the library.

maisonobe commented 1 year ago

This seems strange to me. The plugin is declared in the hipparchus-parent pom.xml. The version is currently set to 3.0.0-M5 (not the latest one, but not tool old). This has worked this way for years. In which pom did you add the plugin and how did you compile the library?

SergyD commented 1 year ago

I am trying to compile the library using mvn install inside of the hipparchus-2.3-src directory. I added the plugin to the pom.xml inside that folder. I am also having issues with some tests not passing so I cannot build the library at all.

The first test that fails is :

[ERROR] Failures: [ERROR] FastMathTest.checkMissingFastMathClasses:1479 FastMath should implement all StrictMath methods

I run Windows 11 and JDK 1.19, which can be the issue. I am not sure if any new StrictMath methods were added in recent Java releases. Which JDK version should I use?

I am also trying to build Orekit without success using the mvn install command, which is also failing me.

This is the log:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project orekit: Fatal error compiling: java.lang.IllegalAccessError: class org.orekit.compiler.plugin.DefaultDataContextPlugin$AnnotationTreeScanner (in unnamed module @0x148b889a) cannot access class com.sun.tools.javac.tree.JCTree (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x148b889a

Looks like it is also a JDK issue, could you tell me which JDK version is used by Orekit?

I am fairly new to Java so maybe I have missing libraries that everyone else already had installed.

maisonobe commented 1 year ago

Running mvn install from the top level directory should work without any change. I'll check that this evening when I'll be back home. Java versions from 8 to 17 are known to work and I usually use OpenJDK 8 for building the official releases. Maybe some new functions have been added to StrictMath with Java 19, I'll check that too.

SergyD commented 1 year ago

I managed to build Hipparchus with JDK 1.17, but Orekit still fails.

maisonobe commented 1 year ago

Did you use OpenJDK or a different implementation? I guess the error comes from the compiler plugin, which allows to detect use of default context. This plugin makes use of internal classes of the Java platform that are present in both OpenJDK and Oracle versions but may be missing in other omplementations.

SergyD commented 1 year ago

I used the official Java SE 17 release from oracle.

SergyD commented 1 year ago

Orekit builds with official Java SE 11 from Oracle just fine.

maisonobe commented 1 year ago

Closing this issue as a duplicate of #272.