[
https://issues.apache.org/jira/browse/MNG-7789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725126#comment-17725126
]
ASF GitHub Bot commented on MNG-7789:
-------------------------------------
hgschmie commented on code in PR #1115:
URL: https://github.com/apache/maven/pull/1115#discussion_r1201130613
##########
maven-core/src/main/java/org/apache/maven/plugin/internal/Maven2DependenciesValidator.java:
##########
@@ -45,19 +46,22 @@ class Maven2DependenciesValidator extends
AbstractMavenPluginDependenciesValidat
}
@Override
- protected void doValidate(MavenSession mavenSession, MojoDescriptor
mojoDescriptor) {
- Set<String> maven2Versions =
mojoDescriptor.getPluginDescriptor().getDependencies().stream()
+ protected void doValidate(
+ RepositorySystemSession session,
+ Artifact pluginArtifact,
+ ArtifactDescriptorResult artifactDescriptorResult) {
+ Set<String> maven2Versions =
artifactDescriptorResult.getDependencies().stream()
+ .map(Dependency::getArtifact)
.filter(d -> "org.apache.maven".equals(d.getGroupId()))
- .filter(d ->
!EXPECTED_PROVIDED_SCOPE_EXCLUSIONS_GA.contains(d.getGroupId() + ":" +
d.getArtifactId()))
- .map(ComponentDependency::getVersion)
+ .filter(d ->
!DefaultPluginValidationManager.EXPECTED_PROVIDED_SCOPE_EXCLUSIONS_GA.contains(
+ d.getGroupId() + ":" + d.getArtifactId()))
+ .map(Artifact::getVersion)
.filter(v -> v.startsWith("2."))
.collect(Collectors.toSet());
if (!maven2Versions.isEmpty()) {
pluginValidationManager.reportPluginValidationIssue(
- mavenSession,
- mojoDescriptor,
- "Plugin is a Maven 2.x plugin, which will be not supported
in Maven 4.x");
+ session, pluginArtifact, "Plugin is a Maven 2.x plugin,
which will be not supported in Maven 4.x");
Review Comment:
this says "will not be supported"
> Plugin Dependency Validations use wrong data set
> ------------------------------------------------
>
> Key: MNG-7789
> URL: https://issues.apache.org/jira/browse/MNG-7789
> Project: Maven
> Issue Type: Improvement
> Components: Plugins and Lifecycle
> Affects Versions: 3.9.2
> Reporter: Tamas Cservenak
> Assignee: Tamas Cservenak
> Priority: Major
> Fix For: 3.9.3, 4.0.0-alpha-6, 4.0.0
>
>
> They all use pluginDescriptor/dependencies, that are NOT used to calculate
> plugin dependencies, POM is. Except for one new check (the one added in
> MNG-7786) the others should be refactored to use POM instead.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)