[MWRAPPER-122] Mingw paths problem on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- build-system
Research direction
Start with the mvnw script and its existing Cygwin path-conversion branch. Reproduce the Taskfile.dev invocation in Windows Git Bash, then verify that the generated Java command uses compatible path separators for the classpath and project directory. Done means the Maven wrapper runs clean install -N without the ClassNotFoundException.
Written by the indexing model from the issue text.
Description
Krystian Panek opened MWRAPPER-122 and commented
When I call the Maven wrapper from Taskfile.dev then only on Windows in GitBash (on Mac and Linux works without problems) the following command is executed (I just replaced the last "exec" statement with "echo" to troubleshoot):
/c/Program Files/Eclipse Adoptium/jdk-11.0.14.101-hotspot/bin/java -classpath C:\Projects\acme-aem-acme-mono-ad86003b367a/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=C:\Projects\acme-aem-acme-mono-ad86003b367a org.apache.maven.wrapper.MavenWrapperMain clean install -N
Note that bad path separators are generated and my task execution results in an error:
task: [aem:build:root] sh mvnw clean install -N && mkdir -p target && touch target/done.txt
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain
task: Failed to run task "aem:build:root": exit status 1
To fix the problem I needed to update the code:
1. For Cygwin, switch paths to Windows format before running java
if $cygwin; then
to the following:
1. For Cygwin or Mingw, switch paths to Windows format before running java
if [ "$cygwin" = true ] || [ "$mingw" = true ]; then
then I have a working exec command generated:
/c/Program Files/Eclipse Adoptium/jdk-11.0.14.101-hotspot/bin/java -classpath /c/Projects/acme-aem-acme-mono-ad86003b367a/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=/c/Projects/acme-aem-acme-mono-ad86003b367a org.apache.maven.wrapper.MavenWrapperMain clean install -N
It would be nice to make the "mvnw script work in more use cases. by introducing the fix like the above or similar making my integration work without problems.
Greetings, Krystian
No further details from MWRAPPER-122
- Dominant language
- Java
- Stars
- 254
- Forks
- 78
- Avg merge
- 9h 4m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-wrapper
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/maven-wrapper#442 ·
-
priority:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/maven-wrapper#280 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-wrapper#441 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/maven-wrapper#425 · 1 comment · 4 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/maven-wrapper#424 ·
All issues in apache/maven-wrapper
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100