maven 查看属性 环境变量

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>

参考:

https://stackoverflow.com/questions/12317609/maven-overview-for-the-values-of-maven-properties

https://books.sonatype.com/mvnref-book/reference/resource-filtering-sect-properties.html

http://www.avajava.com/tutorials/lessons/how-do-i-display-the-value-of-a-property.html

  

猜你喜欢

转载自www.cnblogs.com/wolbo/p/11451058.html