Visitar URL original
versions:display-extension-updates doesn't work for core extensions · Issue #1182 · mojohaus/versions · GitHub
Skip to content

versions:display-extension-updates doesn't work for core extensions #1182

Closed

Description

@theit

According to this comment in PR #908 the versions plugin should be able to discover updates for core extensions defined in .mvn/extensions.xml. At least for me this doesn't work (correctly).

The extensions.xml in one of our projects has the following content:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.1.0 https://maven.apache.org/xsd/core-extensions-1.1.0.xsd">
        <extension>
                <groupId>me.qoomon</groupId>
                <artifactId>maven-git-versioning-extension</artifactId>
                <version>9.8.1</version>
        </extension>
</extensions>

Executing this command:

$ mvn versions:display-extension-updates
[INFO] Scanning for projects...
[INFO]
[INFO] --- me.qoomon:maven-git-versioning-extension:9.8.1 [core extension] ----
[INFO] matching ref: BRANCH - master
[INFO] ref configuration: BRANCH - pattern: .+
[INFO]   describeTagFirstParent: true
[INFO]   version: ${describe.tag}${describe.distance:+-}${describe.distance:-}-g${commit.short}${dirty}
[INFO]   properties:
[INFO]     project.build.outputTimestamp - ${commit.timestamp}
[INFO]
[INFO] com.example:myproject
[INFO] set version to 2.1.0-2-g2b309fb-DIRTY
[INFO]
[INFO]
[INFO] -----------------------< com.example:myproject >------------------------
[INFO] Building myproject 2.1.0-2-g2b309fb-DIRTY
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- versions:2.18.0:display-extension-updates (default-cli) @ myproject ---
[INFO] No extensions have newer versions.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.479 s
[INFO] Finished at: 2024-11-14T20:40:50+01:00
[INFO] ------------------------------------------------------------------------

I'd assume that I'm being informed there's a newer version 9.10.0 for me.qoomon:maven-git-versioning-extension, but... No.

What puzzles me is that by using the goal display-plugin-updates a warning is printed about a missing version declaration for a plugin that isn't declared in the plugins section of the pom:

$ mvn versions:display-plugin-updates
[INFO] Scanning for projects...
[INFO]
[INFO] --- me.qoomon:maven-git-versioning-extension:9.8.1 [core extension] ----
[INFO] matching ref: BRANCH - master
[INFO] ref configuration: BRANCH - pattern: .+
[INFO]   describeTagFirstParent: true
[INFO]   version: ${describe.tag}${describe.distance:+-}${describe.distance:-}-g${commit.short}${dirty}
[INFO]   properties:
[INFO]     project.build.outputTimestamp - ${commit.timestamp}
[INFO]
[INFO] com.example:myproject
[INFO] set version to 2.1.0-2-g2b309fb-DIRTY
[INFO]
[INFO]
[INFO] -----------------------< com.example:myproject >------------------------
[INFO] Building myproject 2.1.0-2-g2b309fb-DIRTY
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- versions:2.18.0:display-plugin-updates (default-cli) @ myproject ---
[INFO]
[INFO] All plugins with a version specified are using the latest versions.
[INFO]
[WARNING] The following plugins do not have their version specified:
[WARNING]   me.qoomon:maven-git-versioning-extension ................ 9.10.0
[INFO]
[INFO] Project requires minimum Maven version for build of: 3.6.4
[INFO] Plugins require minimum Maven version of: 3.6.4
[INFO]
[INFO] No plugins require a newer version of Maven than specified by the pom.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.923 s
[INFO] Finished at: 2024-11-14T20:47:51+01:00
[INFO] ------------------------------------------------------------------------

Funny: As you can see in the console output the newest version is now shown...

Activity

  1. theit commented on Nov 14, 2024

    @theit
    Author

    I forgot to mention that this happens for versions-maven-plugin 2.17.x and the just released 2.18.0, and also for 2.16.x.

  2. andrzejj0 commented on Nov 15, 2024

    @andrzejj0
    Contributor

    Reproduced

  3. self-assigned this
    on Nov 15, 2024
  4. andrzejj0 commented on Nov 15, 2024

    @andrzejj0
    Contributor

    @theit too bad you didn't see this before we released 2.18.0

  5. added this to the 2.18.1 milestone on Nov 15, 2024
  6. added a commit that references this issue on Nov 15, 2024
    1aaa4dc
  7. linked a pull request that will close this issueFixes #1182 and #1184: Bug fixes #1185on Nov 16, 2024
  8. theit commented on Nov 18, 2024

    @theit
    Author

    @theit too bad you didn't see this before we released 2.18.0

    Yes sorry. When I tried this on the command line to figure out what exact command is causing this bug, the versions plugin informed me that a new version of itself was available... :-)
    Then I checked whether this behaviour was already fixed in the new version and then searched in the issue tracker....

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions