concept Apache Twill in category java
appears as: Apache Twill

This is an excerpt from Manning's book The Java Module System.
13.3.2 Spinning up layers for your application, Apache Twill, and Cassandra Java Driver
Say you depend on two projects, Apache Twill and Cassandra Java Driver. They have conflicting version requirements for Guava: Apache Twill breaks on any version after 13, and Cassandra Java Driver breaks on any version before 16. You’ve tried everything you can think of to work around the problem, but nothing has worked, and now you want to solve the problem by using layers.
Listing 13.3 Starter that creates layers for Cassandra, Apache Twill, and the app
public static void main(String[] args) throws ReflectiveOperationException { createApplicationLayers() .findLoader("app") .loadClass("app.Main") .getMethod("main", String[].class) .invoke(null, (Object) new String[0]); #1 } private static ModuleLayer createApplicationLayers() { Path mods = Paths.get("mods"); ModuleLayer cassandra = createLayer( List.of(ModuleLayer.boot()), mods.resolve("cassandra"), "app.cassandra"); #2 ModuleLayer twill = createLayer( List.of(ModuleLayer.boot()), mods.resolve("twill"), "app.twill"); #2 return createLayer( List.of(cassandra, twill), mods.resolve("app"), "app"); #3 } private static ModuleLayer createLayer( #4 List<ModuleLayer> parentLayers, Path modulePath, String rootModule) { Configuration configuration = createConfiguration( parentLayers, modulePath, rootModule); return ModuleLayer .defineModulesWithOneLoader( configuration, parentLayers, ClassLoader.getSystemClassLoader()) .layer(); } private static Configuration createConfiguration( #4