需要每次打包的时候新建一个版本文件(eg:build.jsp)
1.创建模板版本文件:buildVersion.txt
@VERSIONID@.@PACKTIME@
2.追加maven-antrun-plugin组件:pom.xml
org.eclipse.m2e lifecycle-mapping1.0.0 org.apache.maven.plugins maven-antrun-plugin[1.8,) compile run org.apache.maven.plugins maven-antrun-plugin1.8 compile run
这里如果没有指定版本号,eclipse出现以下报错 但并不影响正常执行:
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.8:run (execution: default, phase: compile) pom.xml Maven Project Build Lifecycle Mapping Problem



