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. 【Geek议题】合理的VueSPA架构讨论(下)

    接上篇<[Geek议题]合理的VueSPA架构讨论(上)>传送门. 自动化维护登录状态 登录状态标识符跟token类似,都是需要自动维护有效期,但也有些许不同,获取过程只在用户登录或注册的 ...

  2. ES6 嵌套数组进行解构

    let [foo, [[bar], baz]] = [1, [[2], 3]]; foo // 1 bar // 2 baz // 3 let [ , , third] = ["foo&qu ...

  3. Retrotranslator使用简介(JDK1.5->1.4)

      Retrotranslator是一个可以把JDK1.5(6)下编译的类(或包)转译成JDK1.4下可以识别的类(包)的工具. 为现在还用JDK1.4呢?我想无非是现在的大部分Java Web应用是 ...

  4. 修改 video.js 默认 bufferTime

    1.自建rtmp推流.转发.播放,前端用video.js 发现总延时在2秒多,服务器已优化,看看video.js能否优化 2.引用:在RTMP播放器侧,很重要的一点是:在  NetStream.set ...

  5. 数据库缓存之Memcache知识点

    Memcache知识点总结: 一.Memcache安装及使用 参考地址:https://www.jb51.net/article/66525.htm 1.将下载的Memcache安装文件放到某盘下,如 ...

  6. 职位-CTO:CTO

    ylbtech-职位-CTO:CTO 首席技术官是技术资源的行政管理者,英文为Chief Technical Officer或Chief Technology Officer,简称CTO.其职责是制订 ...

  7. 阶段1 语言基础+高级_1-3-Java语言高级_08-JDK8新特性_第2节 Stream流式思想概述_3_流式思想概述

  8. vue--》分页效果(前端实现)

    <template> <div> <el-table style="width: 100%;" :data="ary"> & ...

  9. python字典-字典方法

    1.kyes() (1)取出字典的key In [32]: myCat Out[32]: {'colr': 'gray', 'size': 'fat'} In [33]: for i in myCat ...

  10. CentOS7 开机启动流程