|
1 | 1 | [](https://github.com/scijava/scijava-java3d/actions/workflows/build.yml) |
2 | 2 |
|
| 3 | +# SciJava Java 3D |
| 4 | + |
| 5 | +This project is a wrapper around Java 3D which adds back needed |
| 6 | +JogAmp dependencies Gluegen and JOGL. |
| 7 | + |
| 8 | +The reason these dependencies are missing by default when depending on |
| 9 | +java3d-core from the pom-scijava BOM is because they normally bring in the |
| 10 | +"main" artifacts (gluegen-rt-main and jogl-all-main) which in turn bring in |
| 11 | +native classifier artifacts for all prebuilt platforms. |
| 12 | + |
| 13 | +This is undesirable for a number of reasons: |
| 14 | + |
| 15 | +* Bloats the dependency graph with binaries irrelevant to the running platform. |
| 16 | + |
| 17 | +* Breaks JPMS automatic module support by introducing multiple JAR files |
| 18 | + resolving to the same module name, something which JPMS disallows. |
| 19 | + |
| 20 | +To work around this, SciJava-based projects can add a dependency on this |
| 21 | +scijava-java3d project to inherit all the needed dependencies transitively: |
| 22 | + |
| 23 | +```xml |
| 24 | +<dependency> |
| 25 | + <groupId>org.scijava</groupId> |
| 26 | + <artifactId>scijava-java3d</artifactId> |
| 27 | +</dependency> |
| 28 | +``` |
| 29 | + |
| 30 | +## About java3d-utils and joal |
| 31 | + |
| 32 | +This scijava-java3d component does not bring in java3d-utils, since you may |
| 33 | +or may not need the features provided by that library. Furthermore, although |
| 34 | +java3d-utils depends on joal-main, which has an analogous issue with the joal |
| 35 | +native classifier artifacts, it is not clear (to me) that joal is ever really |
| 36 | +used by java3d-utils; excluding it completely by default is maybe preferable. |
| 37 | +If your project needs joal, you can add the following dependencies manually: |
| 38 | +```xml |
| 39 | +<dependency> |
| 40 | + <groupId>org.jogamp.joal</groupId> |
| 41 | + <artifactId>joal</artifactId> |
| 42 | +</dependency> |
| 43 | +<dependency> |
| 44 | + <groupId>org.jogamp.joal</groupId> |
| 45 | + <artifactId>joal</artifactId> |
| 46 | + <classifier>${scijava.natives.classifier.joal}</classifier> |
| 47 | +</dependency> |
| 48 | +``` |
0 commit comments