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

Display plugin updates reports extensions as plugins without a defined version #1184

Closed
andrzejj0 opened this issue Nov 15, 2024 · 1 comment · Fixed by #1185
Closed

Display plugin updates reports extensions as plugins without a defined version #1184

andrzejj0 opened this issue Nov 15, 2024 · 1 comment · Fixed by #1185
Assignees
Labels
Milestone

Comments

@andrzejj0
Copy link
Contributor

andrzejj0 commented Nov 15, 2024

See #1182

.mvn/extensions.xml:

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

.mvn/maven-git-versioning-extension.xml:

<configuration xmlns="https://github.com/qoomon/maven-git-versioning-extension"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="https://github.com/qoomon/maven-git-versioning-extension https://qoomon.github.io/maven-git-versioning-extension/configuration-9.4.0.xsd">
  <refs>
    <ref type="branch">
      <pattern>.+</pattern>
      <version>${ref}-SNAPSHOT</version>
      <properties>
        <foo>${ref}</foo>
      </properties>
    </ref>
    <ref type="tag">
      <pattern><![CDATA[v(?<version>.*)]]></pattern>
      <version>${ref.version}</version>
    </ref>
  </refs>
  <!-- optional fallback configuration in case of no matching ref configuration-->
  <rev>
    <version>${commit}</version>
  </rev>
</configuration>
mvn versions:display-plugin-updates

Undesired output:

[WARNING] The following plugins do not have their version specified:
[WARNING]   me.qoomon:maven-git-versioning-extension ................. 9.8.1

Also, extensions are treated as plugins and the mojo lists new available versions:

[INFO] Require Maven 3.0 to use the following plugin updates:
[INFO]   me.qoomon:maven-git-versioning-extension ........... 9.8.1 -> 5.0.2
[INFO] 
[INFO] Require Maven 3.6.3 to use the following plugin updates:
[INFO]   me.qoomon:maven-git-versioning-extension ........... 9.8.1 -> 9.6.3
[INFO] 
[INFO] Require Maven 3.6.4 to use the following plugin updates:
[INFO]   me.qoomon:maven-git-versioning-extension .......... 9.8.1 -> 9.10.0
@andrzejj0 andrzejj0 self-assigned this Nov 15, 2024
@andrzejj0 andrzejj0 added the bug label Nov 15, 2024
@andrzejj0 andrzejj0 changed the title Display plugin updates reports plugin updates for extensions Display plugin updates reports extensions as plugins without version defined Nov 15, 2024
@andrzejj0 andrzejj0 changed the title Display plugin updates reports extensions as plugins without version defined Display plugin updates reports extensions as plugins without a defined version Nov 15, 2024
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Nov 15, 2024
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Nov 15, 2024
@andrzejj0 andrzejj0 added this to the 2.18.1 milestone Nov 15, 2024
@andrzejj0 andrzejj0 linked a pull request Nov 16, 2024 that will close this issue
@andrzejj0 andrzejj0 reopened this Nov 25, 2024
@andrzejj0
Copy link
Contributor Author

andrzejj0 commented Nov 25, 2024

Reopening: that particular extension happens to also be a plugin, so this is a very special case. Regular extensions do not get reported.

Status of this:

  • Maven 4.0.0: the extension/plugin does not get reported by versions-maven-plugin 2.17.1 as a plugin
  • Maven 3.x.x: it does, but that's only because this particular extension is also a plugin.

The question is: why this isn't reported with Maven 4?
How to treat this particular case. Should it be shown? But it's defined as a plugin... Especially in case of a core extension, it's not even present in pom.xml files.

My idea is: just to make the behaviour consistent across Maven 3->4, I will still be removing the plugins that have an extension with the same GAV. But other than that, that's pretty much it.

Thoughts? @slawekjaranowski @slachiewicz

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

Successfully merging a pull request may close this issue.

1 participant