This is an automated email from the ASF dual-hosted git repository.
mbuenger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git
The following commit(s) were added to refs/heads/master by this push:
new cc4c417c [MNGSITE-424] Update system dependency section (#1481)
cc4c417c is described below
commit cc4c417cc82208c6703479667be0d659f67b2e20
Author: Matthias Bünger <[email protected]>
AuthorDate: Wed Dec 10 07:47:09 2025 +0100
[MNGSITE-424] Update system dependency section (#1481)
closes #854
---
.../introduction-to-dependency-mechanism.md | 40 +++++++++++++---------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git
a/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md
b/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md
index 9d62d09f..2dcf8a08 100644
---
a/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md
+++
b/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md
@@ -760,45 +760,53 @@ Starting from Maven 4.0, a new specific BOM packaging has
been introduced. It al
## System Dependencies
-`Important note: This is deprecated.`
+`Important note: Using this scope is not recommended!`
-Dependencies with the scope _system_ are not looked up in the Maven repository
system. Instead the `dependency` element contains a `systemPath` pointing to a
jar on the local file system.
-
-The system scope is commonly used to tell Maven about dependencies provided by
the JDK or the VM. System dependencies are especially useful for resolving
dependencies on artifacts which are now provided by the JDK, but were available
as separate downloads earlier. A typical examples is the Java Authentication
and Authorization Service (JAAS):
+In rare occurrences it's necessary to use a dependency which is not available
in any repository, but only on local machine; For example, a jar of some
commercial application.
+To include such a dependency in the build, the _system_ scope can be used.
+Dependencies with the scope _system_ are not looked up in the Maven repository
system.
+Instead, the `dependency` element contains a `systemPath` pointing to a jar on
the local file system.
```xml
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
...
<dependencies>
<dependency>
- <groupId>javax.security</groupId>
- <artifactId>jaas</artifactId>
- <version>1.0.01</version>
+ <groupId>some.company</groupId>
+ <artifactId>the-artifact</artifactId>
+ <version>1.0.0</version>
<scope>system</scope>
- <systemPath>${java.home}/lib/rt.jar</systemPath>
+ <systemPath>path/to/lib/the.jar</systemPath>
</dependency>
</dependencies>
...
</project>
-
```
-If your artifact is provided by the JDK's `tools.jar`, the system path would
be defined as follows:
+While the _system_ scope is supported, its usage is **not recommended**!
+The dependency is only looked up on this specific file path, which binds the
build to individual machines.
+The recommended approach is to upload the dependency to a [private hosted
repository](/repository-management.html) accessible within the organization.
+This also allows differentiation between dependencies needed for
compile/execution and those only needed for testing, by using _compile_ or
_test_ scope.
+
+### Historical usage: Java EE (`javax`) libraries of the JDK
+
+In the past, the system scope was commonly used to tell Maven about Java EE
(`javax` package) dependencies provided by the JDK that were available as
separate downloads earlier.
+A typical examples is the Java Authentication and Authorization Service (JAAS):
```xml
<project xmlns="http://maven.apache.org/POM/4.0.0">
...
<dependencies>
<dependency>
- <groupId>sun.jdk</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
+ <groupId>javax.security</groupId>
+ <artifactId>jaas</artifactId>
+ <version>1.0.01</version>
<scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ <systemPath>${java.home}/lib/rt.jar</systemPath>
</dependency>
</dependencies>
...
</project>
```
-
+Most of those dependencies are available on Maven central nowadays.
+In general, you should never add any explicit dependencies for classes which
are part of the JDK.