Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-latest-versions ignores dependencies with versions defined as properties #340

Closed
dmsergeevN26 opened this issue Mar 15, 2019 · 2 comments
Milestone

Comments

@dmsergeevN26
Copy link

dmsergeevN26 commented Mar 15, 2019

If you have <dependency> <groupId>a.b.c.d</groupId> <artifactId>e</artifactId> <version>${e.version}</version> </dependency>
it will be completely ignored by the command

@sparsick
Copy link
Contributor

sparsick commented Jul 21, 2019

I could observe a different behavior. The goal use-latest-version overwrite the version that use a property.

Example:
pom.xml snippet:

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring-boot.version>2.1.3.RELEASE</spring-boot.version>
    </properties>

<dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                </plugin>
           </plugins>
        </pluginManagement>

Running mvn versions:use-latest-versions results in:

[INFO] --- versions-maven-plugin:2.7:use-latest-versions (default-cli) @ demo-app ---
[INFO] Major version changes allowed
[INFO] Updated org.springframework.boot:spring-boot-dependencies:pom:${spring-boot.version} to version 2.1.6.RELEASE
[INFO] Major version changes allowed

My expectation is that either the goal ignores versions with properties or it updates the property.

Second observation: The goal use-next-versions doesn't change the BOM import in the above example.

Zegveld added a commit to rigd-loxia/versions-maven-plugin that referenced this issue May 14, 2020
@Zegveld Zegveld mentioned this issue May 14, 2020
@Zegveld
Copy link
Contributor

Zegveld commented May 14, 2020

Ran into the same issue as @sparsick above, created a fix for it, and am already using it locally with much success. See the pull-request for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants