You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2023/04/19 11:06:31 UTC

[GitHub] [maven-site] elharo commented on a diff in pull request #191: docs: system dependencies are not always available

elharo commented on code in PR #191:
URL: https://github.com/apache/maven-site/pull/191#discussion_r1171181009


##########
content/apt/guides/introduction/introduction-to-dependency-mechanism.apt:
##########
@@ -174,9 +174,10 @@ 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.
+   Maven does not add system-scoped dependencies to any classpath.

Review Comment:
   It's been a while but this came up a couple of project ago in my day job, where we spent a lot of effort untangling different kinds of dependency scopes and analyzing dependency graphs. The existing text is wrong in one key respect:
   
   "Dependencies with the scope system are always available and are not looked up in repository." 
   
   However, dependencies with the scope system are *not* "always available". Declaring a dependency such as 
   
   ```
   <dependency>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-site-plugin</artifactId>
             <version>4.0.0-M7</version>
             <scope>system</scope>
   </dependency>
   ```
   
   doesn't magically make it available. This is likely just sloppy writing, and the intent was to document the correct behavior but that's not how the text reads  currently, especially to a dev not steeped in Maven dependency management. 
   
   Let me take another stab at rephrasing this to take into account the points you bring up about non-classpath based resolution of dependencies. 
   



-- 
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