The main scope is used for specifying a directory containing the source of the project. The generated build system will compile the sources from this directory when the project is built. The path given in the {@code directory} field is relative to the project descriptor. The default directory for the default language (Java) is {@code "src/main/java"}.
The test scope is used for specifying a directory containing the unit test source of the project. The generated build system will compile these directories when the project is being tested. The path given in the {@code directory} field is relative to the project descriptor. The default directory for the default language (Java) is {@code "src/test/java"}.
If no scope is specified, the default is {@code main}.
The java language is used for specifying a directory containing the Java sources of the project. The generated build system will compile the sources from this directory using the Java compiler when the project is built. The path given in the {@code directory} field is relative to the project descriptor. The default directory for the main Java sources is {@code "src/main/java"}.
The resources language is used for specifying a directory containing the class-path or module-path resources such as properties files or scripts associated with a project. This directory is meant to be different from the main source directory, in that its contents will be copied to the output directory in most cases (since scripts are interpreted rather than compiled). The default directory for the main resources is {@code "src/main/resources"}.
If no language is specified, the default is {@code java}.
If a module name is specified for resources or script files, then this value modifies the directory where the files will be copied. For example, if a Java module name is "foo.biz", then the {@code foo/bar.properties} resource file will be copied as {@code foo.biz/foo/bar.properties}.
This element can be combined with the {@code targetVersion} element for specifying sources, scripts or resources that are specific to both a particular module and a target version.
If a target version, different from the base version, is specified for resources or script files, then this value modifies the directory where the files will be copied. For example, if {@code targetVersion} is 17, then the {@code foo/bar.properties} resource file will be copied as {@code META-INF/versions/17/foo/bar.properties}.
This element can be combined with the {@code module} element for specifying sources, scripts or resources that are specific to both a particular module and a target version.
When a target path is explicitly specified, the values of the {@code module} and {@code targetVersion} elements are not used for inferring the path (they are still used as compiler options however). It means that for scripts and resources, the files below the path specified by {@code directory} are copied to the path specified by {@code targetPath} with the exact same directory structure. It is user's responsibility to put module and version components in the {@code targetPath} if needed.
Note that for Java source files, a directory with the module name may still be generated despite above statement about {@code module} being ignored, because that directory is generated by the Java compiler rather than Maven.
The default value is {@code false}.
The default value is {@code true}.