Module com.github.sormuras.bach


module com.github.sormuras.bach
Defines the API of 🎼 Bach, the Java Shell Builder.

Modules

A module is either declared by the current project or it is a non-project module. A non-project module is either a system module provided by the Java Runtime or it is an external module that is acquirable and stored in a local directory.

Declared Modules

A declared module is defined via a module-info.java file located within the current project's file tree. A declared module is either a main module or a test module. By convention, the source code for modules is in a directory that is the name of the module. Here's an example project declaring two main modules (com.greetings, org.astro) and one test module (test.integration).

 com.greetings
   main
     java
       com
         greetings
           Main.java
       module-info.java
 org.astro
   main
     java
       org
         astro
           World.java
       module-info.java
 test.integration
   test
     java
       test
         integration
           AstroTests.java
           GreetingsTests.java
       module-info.java
 

System Modules

A system module is provided by a Java Runtime. Here's an excerpt of a listing of system modules provided by a standard OpenJDK Runtime image.

 java.base
 java.compiler
 java.datatransfer
 java.desktop
 java.instrument
 java.logging
 ...
 jdk.zipfs
 
Consult the output of the "java --list-modules" command for a complete listing of all observable system modules for a specific Java image. Also see ModuleFinder.ofSystem() for details.

External Modules

An external module is not declared by the current project nor is it provided by the Java Runtime. An external module has to be provided by the user in form of a modular JAR file.

For example, org.junit.jupiter and all other modules published by the JUnit-Team are considered external modules. Here's a listing of external modules used to compile and launch JUnit Jupiter test runs.


 org.apiguardian.api.jar
 org.junit.jupiter.api.jar
 org.junit.jupiter.engine.jar
 org.junit.jupiter.jar
 org.junit.jupiter.params.jar
 org.junit.platform.commons.jar
 org.junit.platform.console.jar
 org.junit.platform.engine.jar
 org.junit.platform.launcher.jar
 org.junit.platform.reporting.jar
 org.opentest4j.jar
 
By default, the directory .bach/external-modules contains the user-provided modular JAR files.

Links