What is the purpose of mvnw and mvnw.cmd files?

前端 未结 4 1934
余生分开走
余生分开走 2020-12-12 08:50

When I created a Spring Boot application I could see mvnw and mvnw.cmd files in the root of the project. What is the purpose of these two files?

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 09:18

    By far the best option nowadays would be using a maven container as a builder tool. A mvn.sh script like this would be enough:

    #!/bin/bash
    docker run --rm -ti \
     -v $(pwd):/opt/app \
     -w /opt/app \
     -e TERM=xterm \
     -v $HOME/.m2:/root/.m2 \
     maven mvn "$@"
    

提交回复
热议问题