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>

如 想将生成的jar包拷贝到F:\jar\libs

<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="${project.build.directory}">
<include name="${project.artifactId}-${project.version}.jar" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- <execution>-->
<!-- <phase>validate</phase>-->
<!-- <goals>-->
<!-- <goal>run</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <tasks>-->
<!-- <echoproperties />-->
<!-- </tasks>-->
<!-- </configuration>-->
<!-- </execution>-->
</executions>
</plugin> </plugins> </build>

3 拷贝依赖到制定文件夹

includeGroupIds过滤拷贝的groupid
<properties>
<project.targetDir>D:\jar</project.targetDir>
<project.targetServerDir>\\localhost\c$\jar</project.targetServerDir>
</properties>
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.inspur.gs</includeGroupIds>
<outputDirectory>${project.targetDir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

参考:

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

maven 常用插件 拷贝依赖 拷贝jar包 查看属性 环境变量的更多相关文章

  1. maven 打包含有第三方依赖的 jar 包

    maven 打包含有第三方依赖的 jar 包:mvn assembly:assembly

  2. 【Maven】从Maven中导出项目依赖的Jar包

    从SVN上下载源代码 svn export https://10.200.1.201/xxxx/PLATFORM code/ --force --username xxx --password xxx ...

  3. maven buid 导出项目依赖的jar包问题

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencie ...

  4. Eclipse里面的Maven项目如果下载依赖的jar包的源码

    Window---------Properties---------------Maven--------------勾选Download Artifact Sources和Download Arti ...

  5. maven 导出项目所依赖的jar包

    1.在 pom文件中 点击 Run As->Maven Build 2.在 Goals 中输入 dependency:copy-dependencies 3.之后会在 项目目录的 target/ ...

  6. maven项目中 把依赖的jar包一起打包

    1.pom.xml 配置文件: 在pom.xml配置文件中添加 <build> <plugins> <plugin> <artifactId>maven ...

  7. maven工程打包成runnable的jar包,拷贝资源和依赖jar包

    eclipse下新建maven工程,生成runnable的jar包.之前一直是手动拷贝依赖的jar包和资源文件,烦得要死.上网可劲查了一下.解决方案如下. 在pom的配置文件中做如下配置: <b ...

  8. 使用 Maven 插件将 class(字节码文件),resource(资源文件),lib(依赖的jar包)分开打包

    1. 在pom文件中对各个插件进行配置 <?xml version="1.0" encoding="UTF-8"?> <project xml ...

  9. maven中把依赖的JAR包一起打包(转)

    转自:http://lvjun106.iteye.com/blog/1849803 这里所用到的MAVEN-PLUGIN是MAVNE-ASSEMBLY-PLUGIN 官方网站是:http://mave ...

随机推荐

  1. Han Xin and His Troops

    Han Xin and His Troops 中国剩余定理 JAVA板子 /*中国剩余定理,根据公式需要求取大数的逆元*/ import java.math.BigInteger; import ja ...

  2. lunwenzhunbei

    1,android sensors introduction http://developer.android.com/guide/topics/sensors/sensors_overview.ht ...

  3. Cocoapods 版本

    查看当前安装的版本 gem list 卸载版本 gem uninstall cocoapods 安装 gem install cocoapods gem install cocoapods -v 1. ...

  4. datatbales的数据源类型(Data source types)

    数据是复杂的,并且所有的数据是不一样的.因此 DataTables 中有很多的选项可用于配置如何获得表中的数据显示,以及如何处理这些复杂的数据. 本节将讨论 DataTables 处理数据的三个核心概 ...

  5. ctrl+r 调用bash曾经的历史命令

    在bash界面 按ctrl+r 可以调出, bash中曾经的历史命令, 光标会停留在 第一次被匹配的字符上, (即使后面你再输入被匹配的字符, 光标也不移动) 然后, 根据你的需要 来进行任何一次的操 ...

  6. Django路由小知识

    from django.urls import path,re_path from app01 import views urlpatterns = [ re_path(r'^articles/200 ...

  7. Delphi XE2 之 FireMonkey 入门(27) - 数据绑定: TBindingsList: TBindScope

    Delphi XE2 之 FireMonkey 入门(27) - 数据绑定: TBindingsList: TBindScope 如果在编写表达式时, 如果能够随意指认需要的控件就好了(通过 Owne ...

  8. write()与writelines()

    f = open('user','a+') f.write('abcde')   #write只能写字符串 f.writelines(['444','rrrr','uuu'])  #writeline ...

  9. dropna()函数

    参数: axis:       default 0指行,1为列 how:       {‘any’, ‘all’}, default ‘any’指带缺失值的所有行;'all’指清除全是缺失值的 thr ...

  10. unique()与nunique()

    1 unique() 统计list中的不同值时,返回的是array.它有三个参数,可分别统计不同的量,返回的都是array. 当list中的元素也是list时,尽量不要用这种方法. import nu ...