建立和更新maven-eclipse工程,自动脚本:
@echo off set curdir=%~dp0 set partition=%curdir:~0,1% set PROJECT_LIB_DIR=%curdir%\src\main\webapp\WEB-INF\lib set PROJECT_CLASS_DIR=%curdir%\src\main\webapp\WEB-INF\classes %partition%: cd %curdir% echo 创建工程MAVEN目录结构============================ if not exist src\main\java mkdir src\main\java if not exist src\main\resources mkdir src\main\resources if not exist src\main\webapp mkdir src\main\webapp if not exist src\test mkdir src\test if not exist src\test\resources mkdir src\test\resources if not exist src\test\java mkdir src\test\java echo 1.清理MAVEN工程 ================================ call mvn clean echo 2.清理Eclipse工程 ================================= call mvn eclipse:clean echo 3.构建Eclipse工程,并设置编译目录为:/WEB-INF/classes ============================= del /f/s/q %PROJECT_CLASS_DIR%\* call mvn eclipse:eclipse -DdownloadSources=false -DoutputDirectory=%PROJECT_CLASS_DIR% echo 4.生成依赖的jar拷贝到WEB-INF/lib =============================== del /f/s/q %PROJECT_LIB_DIR%\* call mvn dependency:copy-dependencies -DoutputDirectory=%PROJECT_LIB_DIR% echo MAVEN工程构建成功。 pause