Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: system dependencies are not always available #191

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ Introduction to the Dependency Mechanism
unit tests (src/test/java) but not in the model code (src/main/java).

* <<system>>\
This scope is similar to <<<provided>>> except that you have to provide the JAR
which contains it explicitly. The artifact is always available and is not
looked up in a repository.
This scope indicates that the dependency is required for compilation and execution.
However, Maven will not download the dependency from the repository system.
Instead it looks for a jar in the local file system at a specified path.

* <<import>>\
This scope is only supported on a dependency of type <<<pom>>> in the <<<\<dependencyManagement\>>>> section. It
Expand Down Expand Up @@ -826,12 +826,14 @@ Introduction to the Dependency Mechanism

<<<Important note: This is deprecated.>>>

Dependencies with the scope <system> are always available and are not looked
up in repository. They are usually used to tell Maven about dependencies which
are provided by the JDK or the VM. Thus, system dependencies are especially
useful for resolving dependencies on artifacts which are now provided by the
JDK, but were available as separate downloads earlier. Typical examples are
the JDBC standard extensions or the Java Authentication and Authorization
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. Typical
examples are the JDBC standard extensions or the Java Authentication and Authorization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know whether the cae with JDBC and JAAS is still true. I'd try to avoid giving example which are invalid in a couple of years.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is. Per Oracle docs, "The Java Authentication and Authorization Service (JAAS) was introduced as an optional package (extension) to the Java 2 SDK, Standard Edition (J2SDK), v 1.3. JAAS was integrated into the J2SDK 1.4." Unless Oracle decides to remove it again, this statement seems likely to be true for the indefinite future.

Though now that I think about it, I don't really see how this helps to to tell Maven about dependencies provided by the JDK or the VM. If you're in a VM that includes them, this is unnecessary and if you're not then a system dependency doesn't help since it's not there. Maybe if you're compiling with JDK 1.5 but targeting 1.3 or something like that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if, i don't know wether this really helps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with removing this paragraph completely. The case that makes me pause is tools.jar. If I recall correctly that is not in the VM and also is not available from the Maven repo system. Is there any way to load that that is not a system dependency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you custom-bundle Maven with your deps, e.g., extensions or so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what you mean. Do you mean some sort of fat jar? Or perhaps a custom version of Maven? Either way this seems much more complex than a system dependency that points to tools.jar.

To move this PR forward, what specific change in the current text do you propose?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My example was just have a custom JAR which you distribute across your company. That's it.

My proposal is to simply remove all examples regarding system and provide an abstract description/definition of this feature.

Service (JAAS).

A simple example would be:
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@

<properties>
<maven.site.path>maven-site</maven.site.path>
<project.build.outputTimestamp>x</project.build.outputTimestamp><!-- disable Reproducible Builds that makes the site build time fixed at last release time -->
michael-o marked this conversation as resolved.
Show resolved Hide resolved
<project.build.outputTimestamp>x</project.build.outputTimestamp>
<!-- disable Reproducible Builds that makes the site build time fixed at last release time -->
<currentStableVersion>3.9.1</currentStableVersion>
<currentStableVersionDetails>2e178502fcdbffc201671fb2537d0cb4b4cc58f8</currentStableVersionDetails>
<current4xVersion>4.0.0-alpha-5</current4xVersion>
Expand Down