I wanted to know if anyone using IntelliJ could compile Orekit using the javac compiler ?
On my end, i can compile it just fine until release 10.1 with the introduction of the DefaultDataContext which seem to be the cause of my compilation error in addition to a huge penalty in compilation time when using Eclipse compiler.
For now i must switch to the eclipse compiler but it is a bit of a bother to change that everytime my configuration is reset .
Ok i may have found something, it seems that we need to define the path to the Annotation processors in Build,Execution,Deployment â Compiler â Annotation processors.
However and by default, the IDE doesnât find the path even though the pom indicates to look inside :
Hence i think we need to fix the pom but still have not found how. I have been trying several fix with <annotationProcessors>but nothing worked so far.
I use IntelliJ. I didnât know about choosing Eclipse mode, so I assume Iâm using javac mode? Running individual tests from the editor works fine. Some things that help are:
Explicitly use a 1.8 JDK (which Iâm sure you already do) in the project settings
Use maven to perform a âcleanâ and âcompileâ
Right-click on the âcompilerâ folder (which contains the DefaultDataContextPlugin) in the project outline and select âMark directory as â Excludedâ
I think I managed to have this running.
My current settings allowed me to have several JetBrains Idea projects (not JetBrains Idea modules) that depend on each others, and to have the compiler plugin work.
This was done by letting JetBrains Idea match the Maven projects hierarchy, as it can link projects together, and also delegate compilation to an external maven program.
So here is what I did.
I started by cloning manually the various projects within one global directory using git clone, so I ended up with base-directory/hipparchus, base-directory/orekit, base-directory/my-application
then from either the Open button on the JetBrains Idea welcome window or from the File â Open top level menu, I just opened the base-directory/hipparchus/pom.xml file and clicked on the Open as project button in the popup, this created the hipparchus project with its many maven modules
from the File â Open top level menu, I then opened the base-directory/orekit/pom.xml file and clicked on the Open as project button in the popup, this created the orekit project
from the File â Settings top level menu, I navigated in the Settings popup and selected Build, Execution, Deployment â Build Tools â Maven â Runner,
in the Runner settings, I selected both Delegate IDE build/run actions to Maven and Skip Tests
Then, when I run Orekit tests, it is maven that builds the library, but it does not run the tests, JetBrains Idea runs them. Not selecting Skip Tests just means the tests would be run twice, once by maven and once by the IDE.
In order to compile and run my application, I just did step 3 again with my application pom.xml. Note that delegating the build to maven is project-specific, so I did it only for Orekit (i.e. the intermediate level, between Hipparchus and my application), for the other projects, I just let Jetbrains Idea do the compilation using its embedded maven tools.
In my case, as I also wanted to be able to modify all projects, I linked them together. This is done for example in Orekit by selecting View â Tool Windows â Maven in the top level menu, and in the maven tool window that appears, click on the big + button with the Add Maven Projects tooltip and select the top level base-directory/hipparchus/pom.xml file, and performed something similar in my application that depends on both Hipparchus and Orekit. So when I switch Orekit to some branch I am working on and rebuild it, I can use it in my application because it follows the maven dependencies properly.