desruisseaux commented on issue #1428:
URL: https://github.com/apache/maven-site/issues/1428#issuecomment-3410213229
Maybe the following?
## New artefact types
Maven 4 introduces new types of artifacts. The types listed below can be
used in `<dependency>` declarations of JAR files. The `jar` type existed in
Maven 3 and is still the default in Maven 4. The other types are new:
* `jar`: for a JAR file that can be placed either on the class path or on
the module path.
* `classpath-jar`: for a JAR file to unconditionally place on the class path.
* `modular-jar`: for a JAR file to unconditionally place on the module path.
* `processor`: for a JAR file that can be placed either on the annotation
processor class path or module path.
* `classpath-processor`: for a JAR file to unconditionally place on the
annotation processor class path.
* `modular-processor`: for a JAR file to unconditionally place on the
annotation processor module path.
The `jar` and `processor` types use heuristic rules for deciding where to
place the JAR file, but the result is not always what the developer wants. The
types with `classpath-` or `modular-` prefix give control to the developer.
**Limitation:** as of October 2025, only Maven Compiler Plugin 4.0.0-beta-3
complies with the new types. Other plugins will be updated progressively.
## New source declarations
Maven 4 introduces a new way to declare the root directories of source code.
Instead of:
```xml
<project>
<build>
<sourceDirectory>my-custom-dir/foo</sourceDirectory>
<testSourceDirectory>my-custom-dir/bar</testSourceDirectory>
</build>
</project>
```
The source directories should be declared as below:
```xml
<project>
<build>
<sources>
<source>
<scope>main</scope>
<directory>my-custom-dir/foo</directory>
</source>
<source>
<scope>test</scope>
<directory>my-custom-dir/bar</directory>
</source>
</sources>
</build>
</project>
```
The `<source>` element can be repeated, thus allowing multiple source
directories without the need to resort to external plugins. It also provides a
unified way to declare include/exclude filters, makes easier to setup projects
targeting multi Java releases, and enables module source hierarchy. The
documentation of the Maven Compiler Plugin gives some examples.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]