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

Don't require Maven patch version #316

Closed
cbismuth opened this issue Sep 7, 2017 · 6 comments
Closed

Don't require Maven patch version #316

cbismuth opened this issue Sep 7, 2017 · 6 comments
Milestone

Comments

@cbismuth
Copy link

cbismuth commented Sep 7, 2017

Hi,

Is really useful to depend on Maven 3.1.1 or would it be enough to depend on 3.1.0 and let the end-user patch his own installation?

Thanks,
Christophe

@TheSnoozer
Copy link
Collaborator

Hi,
I might not understand the full need of this....

Regardless to answer your question:
The plugin need to depend on some Maven version and this version can not be set by the user.
It furthermore can not be set by the user, since its set inside the pom of the plugin and required for building the plugin.

Please checkout the README to see what maven version are required to run the plugin. If you still rely on an old 3.1.0 version I'd recommend the plugin version 2.1.13, or if possible to upgrade your maven version to 3.1.1 or anything more recent.

@cbismuth
Copy link
Author

cbismuth commented Sep 9, 2017

Hi,

Yes we have an outdated CI installation. I think there might not be any required API change or blocking bug on your side, so why not depend on 3.1.1 and not 3.1.0?

I'll upgrade our CI dependencies, but this question is more about good practice in plugin development: why not depend on the lowest required version of Maven?

@TheSnoozer
Copy link
Collaborator

TheSnoozer commented Sep 9, 2017

I think there might not be any required API change or blocking bug on your side, so why not depend on 3.1.1 and not 3.1.0?

Knowing Maven I wouldn't assume this - you never know ;-)

Regardless as a Plugin Developer I would argument the other way round:
Why can't you update your maven-version to anything more recent? If you can use a maven version that was released on 2013-10-04 (about 4 years ago) what system are you using? Is this still supported by anything?
Usually with updates more features are being shipped or security patches fixed and thus I would rather tend and say why not upgrade to the latest and greatest?

Regardless of this I kinda understand where you are coming from and I can check locally if I see an impact if the version changes, but knowing Maven there is 1209831092 trillion things that are breaking with this simple version change. Furthermore I would also argue why not go back even further and support the 3.0 version then. When going back to 3.0 I would assume even more breaks but I'll check on this...

@TheSnoozer
Copy link
Collaborator

TheSnoozer commented Sep 13, 2017

Just as a personal note:
The maven surfire-plugin uses a somewhat mix of <mavenVersion>2.2.1</mavenVersion> and <mavenPluginPluginVersion>3.3</mavenPluginPluginVersion> this requires a more in-depth investigation what plugin versions needs to be old and what plugin versions need to be "newer" to avoid any issues.

See #295 for a script to test:

#!/bin/bash
for mavenBasePath in /usr/share/maven-3*
do
  echo "============================================"
  ${mavenBasePath}/bin/mvn --version
  echo ""
  # ${file}/bin/mvn clean initialize -Pdemo
  for pluginVersion in 2.2.4-SNAPSHOT
  do
    rm -rf target
    # echo ${pluginVersion}
    echo "${mavenBasePath}/bin/mvn pl.project13.maven:git-commit-id-plugin:${pluginVersion}:revision"
    ${mavenBasePath}/bin/mvn pl.project13.maven:git-commit-id-plugin:${pluginVersion}:revision -Pdemo > /dev/null
    rc=$?;
    if [[ $rc != 0 ]]; then
      echo "pl.project13.maven:git-commit-id-plugin:${pluginVersion} is NOT compatible";
    else
      echo "pl.project13.maven:git-commit-id-plugin:${pluginVersion} is compatible"
    fi

    echo ""
    cat target/testing.properties | sed 's/\(.*\)/  \1/'
  done
done

Results:

  • with <maven-plugin-api.version>2.2.1</maven-plugin-api.version> the tests fail due to random reasons
  • with <maven-plugin-api.version>3.0</maven-plugin-api.version> the tests and execution work with old and new maven work; however for older Maven-Versions (3.0.X) there is a warning from SLF4J:
[INFO] --- git-commit-id-plugin:2.2.4-SNAPSHOT:revision (get-the-git-infos) @ git-commit-id-plugin ---
[INFO] dotGitDirectory /home/stefan/workspace/maven-git-commit-id-plugin/.git
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

TheSnoozer pushed a commit to TheSnoozer/git-commit-id-maven-plugin that referenced this issue Sep 16, 2017
…rsion; note for Maven 3.0.X versions there is a warning from SLF4J that it failed to load StaticLoggerBinder, however execution is working fine
TheSnoozer pushed a commit to TheSnoozer/git-commit-id-maven-plugin that referenced this issue Sep 16, 2017
@TheSnoozer
Copy link
Collaborator

Thanks for your report.
The plugin will now support everything from Maven 3.X (including 3.0) and onwards. I won't provide any support for any Maven 2.X since its deprecated.
In general local tests didn't yield any issues and travis build is configured so it verifies the functionality of some maven versions. Personally testing every maven version would be somewhat against the fair use of travis and unless there is anything in specific that only appears on a specific maven version it might even be a maven bug.

Let's cross fingers that this doesn't break anything.

Maven 3.X will be supported with the next version 2.2.4

@TheSnoozer TheSnoozer added this to the 2.2.4 milestone Sep 16, 2017
@cbismuth
Copy link
Author

Woah, thank you for the hard work and deep investigations @TheSnoozer and @ktoso 👍

@TheSnoozer TheSnoozer mentioned this issue Jun 7, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants