1 maven编译后希望将生产的jar包拷贝到指定目录
在pom中配置maven插件
maven-antrun-plugin
<build > <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>copy-lib-src-webapps</id> <phase>package</phase> <configuration> <tasks> <!-- <delete dir="src/main/webapp/WEB-INFb" />--> <copy todir="F:\jar\libs"> <fileset dir="${env.ACCOUNTINGDOCUMENT_JAVA_PATH}\fi-gl-accountingdocument-core\target"> <include name="fi-gl-accountingdocument-core-1.0-SNAPSHOT.jar" /> </fileset> </copy> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
2 希望使用内置属性 ${properties.property} 方便项目协作
但不清楚有哪些properties 没找到简单的查看properties的方法
增加配置节点 执行validate 控制台会打印具体的properties
<execution> <phase>validate</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <echoproperties /> </tasks> </configuration> </execution>
参考:
1 https://stackoverflow.com/questions/12317609/maven-overview-for-the-values-of-maven-properties
2 https://books.sonatype.com/mvnref-book/reference/resource-filtering-sect-properties.html
3 http://www.avajava.com/tutorials/lessons/how-do-i-display-the-value-of-a-property.html