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

Use the new/real Maven Wrapper #335

Closed
DavidWhitlock opened this issue May 16, 2021 · 7 comments · Fixed by #481
Closed

Use the new/real Maven Wrapper #335

DavidWhitlock opened this issue May 16, 2021 · 7 comments · Fixed by #481

Comments

@DavidWhitlock
Copy link
Collaborator

It looks like Maven wrapper has been promoted to be a first-class citizen in Maven:

https://maven.apache.org/plugins/maven-wrapper-plugin/index.html

I should recreate the Maven wrapper scripts and jars using that plugin.

@DavidWhitlock
Copy link
Collaborator Author

Or maybe not. After upgrading to the latest Maven, I tried running the wrapper:wrapper plugin and I got this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-wrapper-plugin:3.0.2:wrapper (default-cli) on project student: wrapperVersion not supported for Maven 3.8.1, it must be at least 4. -> [Help 1]

So, this doesn't look like it's quite ready for primetime yet.

@DavidWhitlock
Copy link
Collaborator Author

It might be worth giving this a try again.

https://maven.apache.org/wrapper/

https://www.baeldung.com/maven-wrapper

So, it looks like this might do the trick:

mvn -N wrapper:wrapper

@DavidWhitlock
Copy link
Collaborator Author

No dice.

It looks like the official Maven Wrapper plugin still requires Maven 4:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-wrapper-plugin:3.0.2:wrapper (default-cli) on project cs410j: wrapperVersion not supported for Maven 3.8.5, it must be at least 4. -> [Help 1]

@kiwi-oss
Copy link

I had the same error and have been looking for a long time for a solution. Finally, I found it.

When you just call the goal with wrapper:wrapper, for some reason version 3.0.2 of the plugin is used although there are only higher versions available on Maven Central.

If you call the goal explicitly with the latest plugin version, it works:

mvn org.apache.maven.plugins:maven-wrapper-plugin:3.1.1:wrapper

@DavidWhitlock
Copy link
Collaborator Author

Awesome! Thanks for letting me know. I'll give this a try when I start preparing for the Winter offering of my course.

@kiwi-oss
Copy link

You're welcome! I imagine providing a controlled environment is especially useful in the context of Java courses.

It's definitely a blessing for me who was otherwise stuck on a not-so-recent Maven version from the Ubuntu LTS repository which doesn't work with the latest Java versions.

@DavidWhitlock
Copy link
Collaborator Author

Well, the Gilded Rose kata uses the Apache Maven Wrapper: emilybache/GildedRose-Refactoring-Kata@0eab197

So, we should be able to, also.

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 a pull request may close this issue.

2 participants