基于JEES的项目结构,其实和SpringBoot是一致,最近几年很忙,所以没怎么维护,有点生疏了。正好前几天给项目加上了打包的内容,现在整理了下,分享出来。
大致内容分为了4个配置文件:build.xml,build.bat,pom-zip.xml,package.xml,我依次说明下文件的作用和配置内容。
1.build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="package_mod" default="package">
<echo>==================== 模块打包 ====================</echo>
<target name="init">
<echo>拷贝pom文件至WebRoot模块...</echo>
<copy todir="../../web-root/" overwrite="true">
<fileset file="pom-zip.xml"/>
<fileset file="package.xml"/>
</copy>
<echo>拷贝完成!</echo>
</target>
<target name="mvn-package">
<echo>执行MVN命令: clean package -f pom-zip.xml</echo>
<exec executable="build.bat" />
<echo>命令执行成功!</echo>
</target>
<target name="publish">
<echo>发布版本到release目录</echo>
<copy todir="../release/" overwrite="true">
<fileset dir="../../web-root/target/" includes="*.zip"/>
</copy>
<echo>发布完成!</echo>
</target>
<target name="destroy">
<echo>移除临时pom文件...</echo>
<delete file="../../web-root/pom-zip.xml"></delete>
<delete file="../../web-root/package.xml"></delete>
<echo>移除完成!</echo>
</target>
<target name="finish">
<echo>==================== 模块打包结束 =================