I have a license-related compile-cycle question. I developed a rather large Java project that partially uses the Wolfram Engine (for Developers) to perform certain computations. The project is useful even without the Wolfram Engine but, if it is available, certain features are activated and can be used too. My project is currently still private (not open source) but I want to publish it soon.
In order to compile my project, it requires the
JLink.jar since this is the interface to communicate with Mathematica's kernel. This is just for compiling though! Still, to actively use the Mathematica Engine, one requires a fully installed version, activated license, set the classpaths, etc.
This setup works great. I can write tests, even use continuous integration, activate certain tests only if Mathematica is available. Still, it fully compiles because the
JLink.jar is part of the project and it would be easy to grow also for contributors that do not have Mathematica or are not willing to use it (for whatever reason).
Now, since I want to publish it, as far as I understand it, I must remove the
JLink.jar from my project. Is that correct? For example, the Wolfram Engine for Developers FAQ says:
However, the Free Engine license does not permit end-user use
The J/Link Licensee Agreement says:
Licensee may not use, copy, modify, or distribute the Program (electronically or otherwise), or any copy, adaptation, transcription, or merged portion thereof, except as expressly authorized by this Agreement.
However, if I am required to remove the
JLink.jar, the project no longer compiles. I cannot use continuous integration testing on pull requests, new users cannot compile my project either, massive errors in IDEs like IntelliJ, etc.
The only solution I see is to use Java Reflections to decouple my source from the
JLink dependency. As a reference, the Mathematica-REPL IntelliJ Plugin follows exactly this approach.
However, this introduces a new level of complexity and a lot of potential pitfalls. Especially for larger projects and updates, it will be more and more challenging to maintain. So, I wonder if this is really the recommended way.
What is the recommended way to make an open-source project that uses the Wolfram Engine for Developers and, therefore, requires the
JLink.jar to compile? Do not share the
JLink.jar and build a workaround with Java Reflections? Or is it ok to ship
JLink.jar with the project to keep it compilable?