maven打包,脚本内容:
@echo off
echo 正在设置临时环境变量
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45
set MAVEN_HOME=D:\apache-maven-3.2.5
set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
set Path=%JAVA_HOME%\bin;%JAVA_HOME%\jar\bin;%MAVEN_HOME%\bin
pause
start mvn package
保存上述内容为xxx.bat文件,放在pom.xml同级目录,运行
--------------------------------------------------------------------------------------------------------------------
启动myProject.jar,脚本内容:
cd %~dp0
title myProject
"C:\Program Files\Java\jdk1.8.0_91\bin\java.exe" -jar myProject.jar
pause
保存上述内容为xxx.bat文件,放在jar包同级目录,运行
-----------------------------------------------------------------------------