[DON'T MERGE] Trying to setup a test environment in Docker
I'm trying to setup an easy way for people (at least me) to add tests to the project. The goal is to remove the need for installing IntelliJ and all the other requirements that along with Java just to run/add tests. I've tried various version of openjdk and I can't get past this part:
[INFO] Mage Server 1.4.43 ................................. SUCCESS [ 30.547 s]
[INFO] Mage Plugins 1.4.43 ................................ SUCCESS [ 0.003 s]
[INFO] Mage Counter Plugin 0.1 ............................ SUCCESS [ 0.027 s]
[INFO] Mage Client 1.4.43 ................................. FAILURE [ 33.364 s]
[INFO] Mage Server Console 1.4.43 ......................... SKIPPED
[INFO] Mage Tests 1.4.43 .................................. SKIPPED
[INFO] Mage Verify 1.4.43 ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:23 min
[INFO] Finished at: 2020-07-22T20:07:01Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project mage-client: Compilation failure: Compilation failure:
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[6,26] package javafx.application does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[7,26] package javafx.beans.value does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[8,26] package javafx.beans.value does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[9,25] package javafx.concurrent does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[10,26] package javafx.embed.swing does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[11,20] package javafx.scene does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[12,24] package javafx.scene.web does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[13,24] package javafx.scene.web does not exist
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[43,19] cannot find symbol
[ERROR] symbol: class JFXPanel
[ERROR] location: class mage.client.dialog.WhatsNewDialog
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[44,13] cannot find symbol
[ERROR] symbol: class WebView
[ERROR] location: class mage.client.dialog.WhatsNewDialog
[ERROR] /Mage.Client/src/main/java/mage/client/dialog/WhatsNewDialog.java:[45,13] cannot find symbol
[ERROR] symbol: class WebEngine
[ERROR] location: class mage.client.dialog.WhatsNewDialog
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :mage-client
The command '/bin/sh -c apt-get update && apt-get install -y maven && mvn clean install --define skipTests=true' returned a non-zero code: 1
Any help would be appreciated.
Steps to Reproduce
- Install Docker
- From the code directory:
docker build -t xmage .
Expected Results
The image finishes building.
Actual Results
The image errors during compilation and never completes building.
Notes
This was born from conversation in #6875.
I am a developer, but I'm not a Java developer. I'm not sure how to resolve this. I've tried just apt-get install openjfx and that didn't change anything either.
I asked other Java developers for assistance and this is what they delivered. It uses openjdk:11, but it compiles and runs all the tests. I tinkered with it a bit and couldn't get everything running under openjdk:8.
The goal of this is to an easy environment for people to write and run tests without setting up a Java development environment. Here you can copy and tests and run them pretty easily.
Hey, I also had issues building and testing, the JavaFX issue is not new since apparently it is not included in later releases of java/openjdk (see here). I included some scripts into my fork to help me build and start Client and Server, feel free to look around. The required programs are included in the second shebang line since I am using NixOS (maven, openjdk11 and protobuf to be precise).
FYI there's successful docker image builds in this PR: https://github.com/magefree/mage/pull/12828