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. Visual Studio使用技巧 +谷歌浏览器使用技巧总结

    一.总结下visual studio常用的使用技巧,有助于提高效率: 1.给代码行打标记:  ctrl + K :给行打标记:ctrl + K + N:切换标记,即使当前页关闭了,也可以适用此快捷键快 ...

  2. 用Python给头像加上圣诞帽或圣诞老人小图标

    随着圣诞的到来,想给给自己的头像加上一顶圣诞帽.如果不是头像,就加一个圣诞老人陪伴.   用Python给头像加上圣诞帽,看了下大概也都是来自2017年大神的文章:https://zhuanlan.z ...

  3. leetcode-mid-Linked list- 116. Populating Next Right Pointers in Each Node

    mycode   93.97% """ # Definition for a Node. class Node(object): def __init__(self, v ...

  4. ps 等程序的选项的三种风格

    unix options bsd options gnu long options unix options, which may be grouped and must be preceded by ...

  5. Jmeter上传文件、cookie、登录验证

    2.11选择http请求   3.0 cookie 域:十九服务器ip或者域名 路径就是接口路径 登录验证:

  6. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_02 递归_3_练习_使用递归计算阶乘

    结束条件是乘到 当前数字等于1

  7. 网络编程之urllib

    #网络爬虫,从其他的网站上,获取一些有用的内容,存入自己的数据库,然后再展示在指定的位置.#urllib是python自带的模块 1.urllib模块做网络爬虫,爬取网页: from urllib i ...

  8. Python Error: “ImportError: No module named six”,用自动安装解决依赖问题

    在初次运行带有matplotlib包的程序时,被告知了缺少模块(如标题所示).搜索调查后发现在自己安装的python中确实缺少此安装包,接下来,进行了下载.安装.运行,又少了一个模块,再下载.再运行, ...

  9. Selenium WebDriver 数据驱动测试框架

    Selenium WebDriver 数据驱动测试框架,以QQ邮箱添加联系人为示例,测试框架结构如下图,详细内容请阅读吴晓华编著<Selenium WebDiver 实战宝典>: Obje ...

  10. struts2 基础

    框架(frameWork):某一种应用的半成品 struts2: 表现层 处理与页面进行交互的相关功能  hibernate: 持久层 负责业务逻辑数据的持久化  spring: 业务层 负责复杂的业 ...