slachiewicz opened a new issue, #14004:
URL: https://github.com/apache/maven/issues/14004
### Affected version
4.0.0-rc-7; the code is the same on `maven-4.0.x` and `master`
### Bug description
A dependency declared with `<scope>system</scope>` never reaches a class
path built through `DependencyResolver`. A project whose source uses a class
from such a jar compiles with maven-compiler-plugin 3.15.0 and fails with
maven-compiler-plugin 4.0.0-beta-5 on Maven 4.0.0-rc-7 (`package sys does not
exist`).
`DefaultDependencyResolver.resolve` flattens the collected graph with
`getScopeDependencyFilter(pathScope)`, which keeps a node only if its scope is
in `pathScope.dependencyScopes()`. None of the `PathScope` constants lists
`DependencyScope.SYSTEM`, so system-scope nodes are filtered out, although the
resolution scopes behind `main-compile`, `test-compile` and `test-runtime`
include `system` (`Maven4ScopeManagerConfiguration.buildResolutionScopes`).
To reproduce: a jar with `package sys; public class Lib {}`, declared as
<dependency>
<groupId>t</groupId><artifactId>syslib</artifactId><version>1</version>
<scope>system</scope><systemPath>${project.basedir}/lib/syslib.jar</systemPath>
</dependency>
and a source file that uses `sys.Lib`, built with `mvn compile` and
maven-compiler-plugin 4.0.0-beta-5.
System scope is deprecated (#3356), but Maven 4 still accepts it with a
warning, so a build that worked on Maven 3 compiles differently when its
compiler plugin moves to the Maven 4 API.
--
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]