You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/03/25 16:04:48 UTC
[GitHub] [maven-enforcer] slawekjaranowski opened a new pull request, #262: [MENFORCER-467] banDynamicVersions excludedScopes on project level
slawekjaranowski opened a new pull request, #262:
URL: https://github.com/apache/maven-enforcer/pull/262
We should not change default Maven scope filtering for transitive dependencies
---
Put message of violation into exception to be consistent with other rules
Following this checklist to help us incorporate your
contribution quickly and easily:
- [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MENFORCER) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line and body.
- [x] Format the pull request title like `[MENFORCER-XXX] - Fixes bug in ApproximateQuantiles`,
where you replace `MENFORCER-XXX` with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the
commit message.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [x] You have run the integration tests successfully (`mvn -Prun-its clean verify`).
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
--
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
[GitHub] [maven-enforcer] kwin commented on a diff in pull request #262: [MENFORCER-467] banDynamicVersions excludedScopes on project level
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #262:
URL: https://github.com/apache/maven-enforcer/pull/262#discussion_r1148512607
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BanDynamicVersions.java:
##########
@@ -256,10 +231,8 @@ public boolean test(DependencyNode depNode) {
}
}
- private int emitDependenciesWithBannedDynamicVersions(
- Dependency rootDependency, RepositorySystemSession repoSession) throws DependencyCollectionException {
- CollectRequest collectRequest = new CollectRequest(rootDependency, project.getRemoteProjectRepositories());
- CollectResult collectResult = repoSystem.collectDependencies(repoSession, collectRequest);
+ private List<String> emitDependenciesWithBannedDynamicVersions(DependencyNode rootDependency)
Review Comment:
```suggestion
private List<String> collectDependenciesWithBannedDynamicVersions(DependencyNode rootDependency)
```
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/ResolverUtil.java:
##########
@@ -96,6 +96,19 @@ DependencyNode resolveTransitiveDependencies() throws EnforcerRuleException {
return resolveTransitiveDependencies(false, true, Arrays.asList(SCOPE_TEST, SCOPE_PROVIDED));
}
+ /**
+ * Retrieves the {@link DependencyNode} instance containing the result of the transitive dependency
+ * for the current {@link MavenProject}.
+ *
+ * @param excludedScopes a project dependency scope to excluded
Review Comment:
```suggestion
* @param excludedScopes the scopes of direct dependencies to ignore
```
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BanDynamicVersions.java:
##########
@@ -138,19 +124,19 @@ private final class BannedDynamicVersionCollector implements DependencyVisitor {
private boolean isRoot = true;
- private int numViolations;
+ private List<String> violations;
private final Predicate<DependencyNode> predicate;
- public int getNumViolations() {
- return numViolations;
+ public List<String> getNumViolations() {
Review Comment:
```suggestion
public List<String> getViolations() {
```
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/ResolverUtil.java:
##########
@@ -96,6 +96,19 @@ DependencyNode resolveTransitiveDependencies() throws EnforcerRuleException {
return resolveTransitiveDependencies(false, true, Arrays.asList(SCOPE_TEST, SCOPE_PROVIDED));
}
+ /**
+ * Retrieves the {@link DependencyNode} instance containing the result of the transitive dependency
+ * for the current {@link MavenProject}.
+ *
+ * @param excludedScopes a project dependency scope to excluded
+ * @return a Dependency Node which is the root of the project's dependency tree
+ * @throws EnforcerRuleException thrown if the lookup fails
+ */
+ DependencyNode resolveTransitiveDependencies(boolean excludeOptional, List<String> excludedScopes)
Review Comment:
the javadoc for `excludeOptional` is missing
--
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
[GitHub] [maven-enforcer] slawekjaranowski merged pull request #262: [MENFORCER-467] banDynamicVersions excludedScopes on project level
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski merged PR #262:
URL: https://github.com/apache/maven-enforcer/pull/262
--
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