maven clean插件使用进阶

参考

Maven clean 插件

Maven删除外部文件

查看命令帮助

mvn clean:help

mvn clean:help -Ddetail=true -Dgoal=clean

跳过clean和删除指定的文件夹

<properties>
<!--
方式一:跳过clean
3.0.0以前的版本属性是clean.skip,之后的属性是maven.clean.skip
-->
<!--<maven.clean.skip>true</maven.clean.skip>-->
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<!-- 方式二:跳过clean -->
<skip>true</skip> <filesets>
<!-- 删除文件夹generated -->
<fileset>
<directory>src/main/generated</directory>
</fileset>
<!-- 删除mozq文件夹中符合条件的,但是不会删除mozq文件夹 -->
<fileset>
<directory>src/main/mozq</directory>
<includes>
<include>*.txt</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ demo-01 ---
[INFO] Deleting D:\00\mozq_pro1\shiro\demo-01\src\main\generated (includes = [], excludes = [])
[INFO] Deleting D:\00\mozq_pro1\shiro\demo-01\src\main\mozq (includes = [*.txt], excludes = [])
[INFO] ------------------------------------------------------------------------

帮助

Maven Clean Plugin
The Maven Clean Plugin is a plugin that removes files generated at build-time
in a project's directory. clean:clean
Goal which cleans the build.
This attempts to clean a project's working directory of the files that were
generated at build-time. By default, it discovers and deletes the directories
configured in project.build.directory, project.build.outputDirectory,
project.build.testOutputDirectory, and project.reporting.outputDirectory. Files outside the default may also be included in the deletion by configuring
the filesets tag. Available parameters: excludeDefaultDirectories (Default: false)
Disables the deletion of the default output directories configured for a
project. If set to true, only the files/directories selected via the
parameter filesets will be deleted.
Expression: ${clean.excludeDefaultDirectories} failOnError (Default: true)
Indicates whether the build will continue even if there are clean errors.
Expression: ${maven.clean.failOnError} filesets
The list of file sets to delete, in addition to the default directories.
For example:
<filesets>
<fileset>
<directory>src/main/generated</directory>
<followSymlinks>false</followSymlinks>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>*.java</include>
</includes>
<excludes>
<exclude>Template*</exclude>
</excludes>
</fileset>
</filesets> followSymLinks (Default: false)
Sets whether the plugin should follow symbolic links while deleting files
from the default output directories of the project. Not following symlinks
requires more IO operations and heap memory, regardless whether symlinks
are actually present. So projects with a huge output directory that
knowingly does not contain symlinks can improve performance by setting
this parameter to true.
Expression: ${clean.followSymLinks} retryOnError (Default: true)
Indicates whether the plugin should undertake additional attempts (after a
short delay) to delete a file if the first attempt failed. This is meant
to help deleting files that are temporarily locked by third-party tools
like virus scanners or search indexing.
Expression: ${maven.clean.retryOnError} skip (Default: false)
Disables the plugin execution.
Expression: ${clean.skip} verbose
Sets whether the plugin runs in verbose mode. As of plugin version 2.3,
the default value is derived from Maven's global debug flag (compare
command line switch -X).
Expression: ${clean.verbose}

maven clean插件使用进阶的更多相关文章

  1. 学习Maven之Maven Clean Plugin

    1.maven-clean-plugin是个什么鬼? maven-clean-plugin这个插件用maven的人都不陌生.我们在执行命令mvn clean时调用的就是这个插件. 这个插件的主要作用就 ...

  2. Maven 的插件和生命周期的绑定

    一.Maven 的生命周期 Maven 的生命周期是对所有的构建过程进行抽象和统一.Maven 的生命周期是抽象的,这意味着生命周期本身不做任何实际的工作,生命周期只是定义了一系列的阶段,并确定这些阶 ...

  3. [maven] 常用插件解析

    参考资料:http://my.oschina.net/zh119893/blog/276090 我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完 ...

  4. maven+mybatis-generator插件反向生成源代码

    通过maven+mybatis-generator插件反向生成源代码,如有一个table表为resource,那么将自动生成这样三个文件:Resource.java类.ResourceMapper.j ...

  5. maven常用插件配置详解

    常用插件配置详解Java代码    <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...

  6. Maven常用插件简单配置

    好久不见,甚是想念.一日不见,如隔三秋. 从春节到现在已经很久没有回归博客园了,今天回来温习一下maven常用的一些插件的配置,学东西一个很简单的诀窍就是重复重复再重复,这样一定能把知识掌握的很牢靠. ...

  7. Maven 默认插件以及功能

    Maven 默认插件 已知 Maven 使用 plugin 来执行实际操作的,在默认情况下,Maven 会绑定以下几个插件来完成基本操作. plugin function life cycle pha ...

  8. eclipse maven build、maven clean、maven install和maven test的区别 精析

          1.情景展示 选中maven项目,右键-->Run As或Debug As-->maven buid,maven install,maven test有什么区别? 2.区别说明 ...

  9. 13 Maven 编写插件

    Maven 编写插件 Maven 的任何行为都是由插件完成的,包括项目的清理.绵编译.测试以及打包等操作都有其对应的 Maven 插件.每个插件拥有一个或者多个目标,用户可以直接从命令行运行这些插件目 ...

随机推荐

  1. Ubuntu 无法打开系统设置

    最近不知道咋搞得,导致系统设置打不开,可能是系统输入法的问题吧,运行以下命令: sudo apt-get install gnome-control-center

  2. ABAP分享三 批量上传数据到内表简单示例

    tYPE-POOLS: truxs. DATA: BEGIN OF build, name(10) TYPE c,   age(3)   TYPE c,   sex(2)   TYPE c,   sp ...

  3. Oracle通过SQL语句查看table所引用的对象(View/Function/Procedure/Trigger)

    通过使用user_dependencies进行查看,如下: SELECT * FROM user_dependencies WHERE referenced_name='SFCUSN' --Table ...

  4. Cocos2d-x项目编译为Android应用——命令行方式

    配置: 相关工具:Cocos2d-x 3.2 + Ant 1.9.4 + Android NDK r9d + Android SDK 运行平台:OS X 10.9.4+ Xcode 6 前言:笔者使用 ...

  5. [阅读笔记]EfficientDet

    EfficientDet 文章阅读 Google的网络结构不错,总是会考虑计算性能的问题,从mobilenet v1到mobile net v2.这篇文章主要对近来的FPN结构进行了改进,实现了一种效 ...

  6. 13. java String类

    一.字符串类 /* java.lang.String类代表字符串 程序中所有的双引号字符串,都是String类的对象.就算没有new 字符串中的内容,永不变:不可变 字符串效果上相当于是char[]字 ...

  7. Unable to open debugger port: java.net.SocketException

    网上都说是tomcat端口被占用,其实不是,这是因为文件权限不够,脚本不能执行,debug当然不能接受网络连接的数据 可以在Event Log里看到 所以只需要更改文件的级别就可以了(可读可写可执行) ...

  8. 激活函数-Activation Function

    该博客的内容是莫烦大神的授课内容.在此只做学习记录作用. 原文连接:https://morvanzhou.github.io/tutorials/machine-learning/tensorflow ...

  9. Java描述设计模式(10):组合模式

    本文源码:GitHub·点这里 || GitEE·点这里 一.生活场景 1.文件系统 下图是常见的计算机文件系统的一部分. 文件系统是一个树结构,树上长有节点.树的节点有两种: 树枝节点 即文件夹,有 ...

  10. Spring注解的使用和组件扫描

    非常重要] 组件扫描(Component-Scan) 通过配置组件扫描,可以使得spring自动扫描package,而不必在spring的配置文件中逐一声明各个<bean> 在配置组件扫描 ...