This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
forked from bdemers/maven-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 234
Added support for paths with spaces, and bats tests. #25
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The maven wrapper script currently does not work in folder heirarchies that contain spaces. The simple fix was to quote the $(pwd) statements in find_maven_basedir along with some more quote-fu on the MAVEN_PROJECTBASEDIR and MAVEN_OPTS line, but I opted for a change that would be testable instead. This involved parameterizing find_maven_basedir, and reorganizing the script to make the actual body of it excludable by bats when it is loaded. My apologies as this will make the PR a bit messier than need be for this change, but I will do my best to highlight the most relevant bits. I did incorporate the bats run as part of the automation launched when building yet as that would require a dependency on an external toolset and should be probably be discussed first.
Also, incorporated the changes in #21 as I was already dealing with pathing. |
Possibly related to #23 |
chipkillmar
reviewed
Nov 4, 2016
@@ -118,7 +118,7 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s | |||
|
|||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" | |||
|
|||
set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"" | |||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change, I'm seeing the following error on Windows when running mvnw.cmd
in a directory name that contains spaces:
Error: Could not find or load main class With Spaces\.mvn\wrapper\maven-wrapper.jar
👍
mosabua
added a commit
that referenced
this pull request
Apr 5, 2017
Replaced with simple commit of fix in 2fea7af |
asfgit
pushed a commit
to apache/maven
that referenced
this pull request
May 2, 2020
asfgit
pushed a commit
to apache/maven
that referenced
this pull request
May 23, 2020
asfgit
pushed a commit
to apache/maven
that referenced
this pull request
Jun 21, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The maven wrapper script currently does not work in folder heirarchies that contain spaces. The simple fix was to quote the $(pwd) statements in find_maven_basedir along with some more quote-fu on the MAVEN_PROJECTBASEDIR and MAVEN_OPTS line, but I opted for a change that would be testable instead.
This involved parameterizing find_maven_basedir, and reorganizing the script to make the actual body of it excludable by bats when it is loaded.
My apologies as this will make the PR a bit messier than need be for this change, but I will do my best to highlight the most relevant bits.
I did incorporate the bats run as part of the automation launched when building yet as that would require a dependency on an external toolset and should be probably be discussed first.
Tested with bats tests, and manually on the local projects here that first exposed the issue.