You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "desruisseaux (via GitHub)" <gi...@apache.org> on 2024/11/25 13:20:42 UTC
[PR] Add a element in the model. [maven]
desruisseaux opened a new pull request, #1936:
URL: https://github.com/apache/maven/pull/1936
Add a `<Source>` element in the model. Properties are:
- `directory` (inherited from `FileSet`)
- `includes` (inherited from `PatternSet`)
- `excludes` (inherited from `PatternSet`)
- `scope`
- `lang`
- `module`
- `targetVersion`
- `targetPath` (taken from `<Resource>`)
- `filtering` (taken from `<Resource>`)
- `enabled`
This commit also renames `source` parameter value in `reader-stax.vm` for avoiding name collision with the new `Source` model element.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857065914
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target 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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetPath</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies an explicit target path, overriding the default value.
+ The path is relative to the {@code ${project.build.outputDirectory}} directory,
+ which is typically {@code target/classes} in a Java project.
+
+ <p>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.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>filtering</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Whether resources are filtered to replace tokens with parameterized values.
+ The values are taken from the {@code properties} element and from the properties
+ in the files listed in the {@code filters} element.
+
+ <p>This filtering should not be confused with the filtering of paths done by the
+ {@code includes} and {@code excludes} patterns.</p>
+
+ <p>The default value is {@code false}.</p>
+ ]]>
+ </description>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ </field>
+ <field>
+ <name>enabled</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Whether the directory described by this source element should be included in the build.
Review Comment:
I guess so. I wasn't aware of that. How should we express that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1856948252
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target 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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetPath</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies an explicit target path, overriding the default value.
+ The path is relative to the {@code ${project.build.outputDirectory}} directory,
+ which is typically {@code target/classes} in a Java project.
+
+ <p>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.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>filtering</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Whether resources are filtered to replace tokens with parameterized values.
+ The values are taken from the {@code properties} element and from the properties
+ in the files listed in the {@code filters} element.
+
+ <p>This filtering should not be confused with the filtering of paths done by the
+ {@code includes} and {@code excludes} patterns.</p>
+
+ <p>The default value is {@code false}.</p>
+ ]]>
+ </description>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ </field>
+ <field>
+ <name>enabled</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Whether the directory described by this source element should be included in the build.
Review Comment:
Would it make sense to reuse the new condition syntax here ?
https://maven.apache.org/ref/4-LATEST/apidocs/org/apache/maven/api/model/Activation.html#condition-syntax-heading
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857061400
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target 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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetPath</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies an explicit target path, overriding the default value.
+ The path is relative to the {@code ${project.build.outputDirectory}} directory,
+ which is typically {@code target/classes} in a Java project.
+
+ <p>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.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>filtering</name>
+ <version>4.1.0+</version>
+ <description>
+ < talked about "string template" or "string interpolation", but I think that what Maven is doing is simpler (e.g., I don't think that `${x + y}` computes the sum?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1856944659
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target 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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetPath</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies an explicit target path, overriding the default value.
+ The path is relative to the {@code ${project.build.outputDirectory}} directory,
+ which is typically {@code target/classes} in a Java project.
+
+ <p>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.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>filtering</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Whether resources are filtered to replace tokens with parameterized values.
+ The values are taken from the {@code properties} element and from the properties
+ in the files listed in the {@code filters} element.
+
+ <p>This filtering should not be confused with the filtering of paths done by the
Review Comment:
If this is confusing, maybe we should find a better name ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857010986
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
Review Comment:
It is a Java compiler convention. In a multi-modules project, `javac` automatically inserts module names at the root of class directories. For example, if a module named `my.foo.module` contains a `foo.bar.biz.Bla` class, then in single-module project (as today), `javac` generates the following file in the Maven `target/classes/` directory:
* `foo/bar/biz/Bla.class`
But in a multi-modules project (would be optional and not the default), `javac` generates the same file at the following location instead:
* `my.foo.module/foo/bar/biz/Bla.class`
Other Java tools such as `java` understand this directory hierarchy. I.e. the `--module-path` can be a directory of modules, with no need to enumerate on the path each module found in the directory. I'm not sure if it is a requirement that the directory names match module names, but this is what `javac` does at least by default.
Above documentation of `module` element tries to match what `javac` does. It could be rephrased as _"During Java compilation, we let `javac` do whatever it wants. For resources, we try to copy them in the same directory as `javac`"_. The current wording tries to be more specific about what happens, but the goal is to match `javac` and the documentation would be updated if we find mismatches.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857287479
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target version is specified for resources or script files,
Review Comment:
Agreed. So specifying a target version for the `source` is not sufficient to create a multi-release jar. That's why I think the sentence:
> If a target version is specified for resources or script files, then this value modifies the directory where the files will be copied.
is not completely accurate. This is only the case if the version is not the base one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1856940357
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target version is specified for resources or script files,
Review Comment:
Should that be `if a target version, different from the default target, version is specified` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1856940357
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target version is specified for resources or script files,
Review Comment:
Should that be `if a target version, different from the default target, version is specified` ?
I'm thinking about the use case where the compiler option *and* the `source` option are both set to `17` for example. This should not result in a multi-release jar, so the resources would be put in the default location.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1936:
URL: https://github.com/apache/maven/pull/1936#issuecomment-2498209454
Error in javadoc:
https://github.com/apache/maven/actions/runs/12010924190/job/33478988107#step:11:4026
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8395] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on PR #1936:
URL: https://github.com/apache/maven/pull/1936#issuecomment-2609430326
Another work needed is to ensure that the new `<source>` tag is propagated by classes such as `DefaultModelPathTranslator.java`. I started that work in https://github.com/Geomatys/maven/commit/5c625d34080102079d15c4bda2a94e263aa636e5 but didn't tested it yet (I have been delayed by other work lately, but hope to be more active in March).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8395] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1936:
URL: https://github.com/apache/maven/pull/1936#issuecomment-2609361489
I wonder if we should include in next RC. @cstamas ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1856937400
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
Review Comment:
Is that a Maven convention, a Java convention, or something imposed by the JVM ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857034886
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target version is specified for resources or script files,
Review Comment:
I was thinking that no multi-release JAR file would be created if there is only one version, regardless if that version matches the default or source version. More specifically, the lowest version is the base version (the one which is not in `META-INF/versions`), regardless the version number. Then, all other versions (if any) are put in `META-INF/versions`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1936:
URL: https://github.com/apache/maven/pull/1936#issuecomment-2498548252
I like it a lot, this would solve a number of problems.
I think we'd need to deprecate the previous `resources`, `sourceDirectory`, `scriptSourceDirectory` and `testSourceDirectory` in the 4.x model.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a element in the model. [maven]
Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #1936:
URL: https://github.com/apache/maven/pull/1936#discussion_r1857361322
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1945,6 +1965,178 @@
</codeSegments>
</class>
<class>
+ <name>Source</name>
+ <description>
+ <![CDATA[
+ Description of the sources associated with a project main code or unit tests.
+ The sources can be Java source files, generated source files, scripts or resources for examples.
+ A source is specified by a mandatory {@code directory} element, which is relative to the POM.
+ The directory content can optionally by reduced to a subset with the {@code includes} and
+ {@code excludes} elements. The kind of sources (codes, resources, <i>etc.</i>) and their
+ usage (main code, tests, <i>etc.</i>) is specified by the {@code scope} element.
+
+ <h2>Default source directories</h2>
+ If no source directories are specified, the defaults are {@code src/${scope}/${lang}} where
+ {@code ${scope}} is the value of the {@link #scope} element (typically {@code main} or {@code test}) and
+ {@code ${lang}} is the value of the {@link #lang} element (typically {@code java} or {@code resources}).
+ ]]>
+ </description>
+ <version>4.1.0+</version>
+ <superClass>FileSet</superClass>
+ <fields>
+ <field>
+ <name>scope</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies in which context the source files will be used - typically {@code main} or {@code test}.
+
+ <p>The <b>main</b> 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"}.</p>
+
+ <p>The <b>test</b> 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"}.</p>
+
+ <p>If no scope is specified, the default is {@code main}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>lang</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Specifies the language of the source files - typically {@code java} or {@code resources}.
+ Resources is used as a generic term for scripting languages (e.g., JavaScript or Python)
+ or markup languages (e.g. properties file, <abbr>JSON</abbr> or <abbr>XML</abbr>).
+
+ <p>The <b>java</b> 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"}.</p>
+
+ <p>The <b>resources</b> 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"}.</p>
+
+ <p>If no language is specified, the default is {@code java}.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ <defaultValue>main</defaultValue>
+ </field>
+ <field>
+ <name>module</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ Name of the Java module (or other language-specific module) which is built by the sources.
+ This element can be specified in a Maven project containing multiple Java modules.
+ It is generally not needed for non-modular projects, or for modular projects having only one module.
+
+ <p>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}.</p>
+
+ <p>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.</p>
+ ]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>targetVersion</name>
+ <version>4.1.0+</version>
+ <description>
+ <![CDATA[
+ The version of the platform where the code will be executed.
+ In a Java environment, this is the value of the {@code --release} compiler option.
+ If a Java project contains multiple main sources with different target versions,
+ then a multi-version <abbr>JAR</abbr> file will be created.
+ If this element is omitted, then the default target version is the compiler default value,
+ which is usually the version of the Java environment running Maven.
+
+ <p>If a target version is specified for resources or script files,
Review Comment:
Ah, understood. You are right. I will fix tomorrow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8395] Add a element in the model. [maven]
Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1936:
URL: https://github.com/apache/maven/pull/1936#issuecomment-2609435649
> I wonder if we should include in next RC. @cstamas ? Though it would require a bit more work to fix the deprecation and migration stuff. We've done a similar thing for `module` -> `subproject`.
I'd say go for it. We have many other things to sort out anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8395] Add a element in the model. [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #1936:
URL: https://github.com/apache/maven/pull/1936
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org