Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module names for better Java 9/Jigsaw support #274

merged 2 commits into from Mar 27, 2018


None yet
3 participants
Copy link

lossyrob commented Mar 23, 2018

The Jigsaw module system requires that downstream users of JTS using the module system declare JTS as a module requirement. JTS acts as an automatic module, since it is not compiled with a Without this change, module users would have to reference the requirement for JTS by specifying the JAR name with the fully qualified version; this is unwieldy, will trigger necessary updates when updating the JTS version, and could cause errors when transitive dependencies rely on other versions of JTS.

This change utilizes the technique of putting the module name in the manifest, so that libraries declaring modules can refer to JTS with more friendly, version-less names, e.g.:

// for project

module {
  requires org.locationtech.jts;            // jts-core
  requires;         // jts-io-common
  requires;  // jts-io-ora
  requires;     // jts-io-sde

Testing Instructions

To verify this work, I defined a file and a file, as follows:



import org.locationtech.jts.JTSVersion;
import org.locationtech.jts.algorithm.distance.DistanceToPoint;

public class Foo {
  public static void main(String[] args)
    ParseException e = new ParseException("asdf");
    DistanceToPoint d = new DistanceToPoint();

module {
  requires org.locationtech.jts;

I then compiled and ran Foo as a module:

> mkdir mods
> javac --module-path ./modules/core/target/jts-core-1.15.1-SNAPSHOT.jar:./modules/io/common/target/jts-io-common-1.15.1-SNAPSHOT.jar \
        -d mods/foo \ \
> java --module-path mods:./modules/core/target/jts-core-1.15.1-SNAPSHOT.jar:./modules/io/common/target/jts-io-common-1.15.1-SNAPSHOT.jar -m

Expected output:


This is building JTS with java 8 against commit 3fb74b6

Added maven properties required for building against mvn 3.5.3 and Ja…
…va 9

Signed-off-by: lossyrob <>

@lossyrob lossyrob force-pushed the lossyrob:java-9-jigsaw branch from 6555edf to 6dc0a94 Mar 23, 2018


This comment has been minimized.

Copy link

This comment has been minimized.

Copy link

lossyrob Mar 23, 2018

Author Member


Add module names for better Java 9/Jigsaw support
Signed-off-by: lossyrob <>

@lossyrob lossyrob force-pushed the lossyrob:java-9-jigsaw branch from 6dc0a94 to 8dd5804 Mar 23, 2018

@jodygarnett jodygarnett merged commit 181003a into locationtech:master Mar 27, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.