Skip to content

Artifact is resolved incorrectly - v5.46.3 #915

Open
@torsten-liermann

Description

I am working on a larger Maven project and would find it difficult to provide the problem as a test case. However, perhaps the implementers of the Maven plugin might have an idea where the root cause of the issue lies. The task is the migration of pom.xml files.

The Maven plugin is invoked via the command line:
mvn org.openrewrite.maven:rewrite-maven-plugin:5.46.3:run -Drewrite.configLocation=https://raw.githubusercontent.com/torsten-liermann/openrewrite-pom-manipulation/refs/heads/main/rewrite.yml -Drewrite.activeRecipes=MigrateEAPDependencies

At the 80th pom.xml file, OpenRewrite fails with the following error:

[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:5.46.3:run (default-cli) on project ok-cash-produkt: Failed to parse or resolve the Maven POM file or one of its dependencies; We can not reliably continue without this information. Failed to parse or resolve the Maven POM file or one of its dependencies; We can not reliably continue without this information. 

The actual issue is that OpenRewrite uses an incorrect version number for this artifact. The correct version, set via a property in a parent pom.xml, is 1.6.1.

In the dependency management section of the parent pom.xml, it is defined as follows:

<dependency>
    <groupId>org.swinglabs</groupId>
    <artifactId>swingx</artifactId>
    <version>${version.org.swinglabs.swingx}</version>
</dependency>

The version property is defined in the same parent pom.xml as:

<version.org.swinglabs.swingx>1.6.1</version.org.swinglabs.swingx>

It's not an issue with the version property in dependency management. Even when I specify a fixed version there, the problem persists unchanged.

If the version is specified explicitly, it works.

The build runs successfully without OpenRewrite and correctly uses version 1.6.1 as expected.

It is worth mentioning this transitive dependency (from the effective-pom):

<dependency>
    <groupId>de.domain.bundles.org.swinglabs</groupId>
    <artifactId>swingx</artifactId>
    <version>1.6.5</version>
    <scope>provided</scope>
</dependency>

Is it possible that the artifact being checked is only identified by the artifactId and/or that the groupId is only checked using "contains"?

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions