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

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

Closed
theit opened this issue Nov 14, 2024 · 4 comments · Fixed by #1185
Closed

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

theit opened this issue Nov 14, 2024 · 4 comments · Fixed by #1185
Assignees
Labels
Milestone

Comments

@theit
Copy link

theit commented Nov 14, 2024

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...

@theit
Copy link
Author

theit commented Nov 14, 2024

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.

@andrzejj0
Copy link
Contributor

Reproduced

@andrzejj0 andrzejj0 added the bug label Nov 15, 2024
@andrzejj0 andrzejj0 self-assigned this Nov 15, 2024
@andrzejj0
Copy link
Contributor

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

@theit
Copy link
Author

theit commented Nov 18, 2024

@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