Skip to content

Conversation

@pan3793
Copy link
Member

@pan3793 pan3793 commented Jan 30, 2026

This adds an ability for the Yetus Maven plugin to auto-detect Maven Wrapper, if applicable.

The priority of the MVN command resolution:

  • user-specificed through --mvn-cmd=<file>, then
  • ${BASEDIR}/mvnw, then
  • ${MAVEN_HOME}/bin/mvn, then
  • mvn

@pan3793 pan3793 changed the title Support detecting Maven Wrapper YETUS-1259. Support detecting Maven Wrapper Jan 30, 2026
@pan3793
Copy link
Member Author

pan3793 commented Jan 30, 2026

cc @aajisaka @steveloughran, this will benefit Hadoop to adopt Maven Wrapper so devs won't worry about Maven setup.

@ndimiduk
Copy link
Member

Love it. I think that we should prefer using mvnw if it's present in the project root, falling back to binary detection otherwise.

@pan3793
Copy link
Member Author

pan3793 commented Jan 31, 2026

@ndimiduk, okay, I fliped the order of detecting MAVEN_HOME/bin/mvn and $BASEDIR/mvnw, how about now?

if [[ -z "${MAVEN_HOME:-}" ]]; then
MAVEN=mvn
else
if [[ -e "${BASEDIR}/mvnw" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add support for windows here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aw-was-here, sorry I don't know what I can do here, I glanced gradle.sh, which seems to have no Windows-specific logic for gradlew detection

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants