# ModularitySpec

interface ModularitySpec(source)

Description of the modularity of a classpath.

A classpath is a list of JAR files, classes and resources folders passed to one of the JDK's commands like javac, java, or javadoc. Since Java 9, these commands offer two different approaches to handle such a classpath:

- A traditional classpath by using the --classpath parameter.
- A modular classpath (module path) using the --module-path parameter.

If the --module-path is used, the Java Platform Module System (JPMS) becomes active and the module descriptors (module-info.class) files are used to limit visibility of packages between modules at compile and runtime.

Wherever a classpath (a list of files and folders) is configured in Gradle, it can be accompanied by a ModularClasspathHandling object to describe how the entries of that list are to be passed to the --classpath and --module-path parameters.

#### Since

6.4

## Functions

getInferModulePath
Link copied to clipboard
@Input
abstract fun getInferModulePath(): Property<Boolean>
Should a --module-path be inferred by analysing JARs and class folders on the classpath?