Common Maven plug-in parameters and maven plug-ins

Source: Internet
Author: User

Common Maven plug-in parameters and maven plug-ins

1. clean:

Clear files not in the default path

<Build> [...] <plugin> <artifactId> maven-clean-plugin </artifactId> <version> 2.6.1 </version> <configuration> <filesets> <fileset> <directory> some/relative/path </directory> customize the file to be cleared, relative Path <shortdes> <include> **/*. tmp </include> <include> **/*. log </include> </includes> <excludes> <exclude> **/important. log </exclude> <exclude> **/another-important.log </exclude> </excludes> <followSymlinks> false </followSymlinks> </fileset> </filesets> </configuration> </plugin> [...] </build>

This project does not run clean: skip = true

2. compile: by default, it is always compiled by JDK1.5 and can be customized.

<project>  [...]  <build>    [...]    <plugins>      <plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-compiler-plugin</artifactId>        <version>3.2</version>        <configuration>          <source>1.8</source>          <target>1.8</target>        </configuration>      </plugin>    </plugins>    [...]  </build>  [...]</project>

Test-compile: Do not compile the test class: skip = true

3. install:

Do not install it on the local code library: skip = true

Install and upgrade to the official version:UpdateReleaseInfo= True

4.Process-resources:

Set encoding: encoding = UTF-8

Forcibly replace the target file, even if the target is up to date:Overwrite= True

Files that do not use the preload Resource function:NonFilteredFileExtensions=, Default: jpg, jpeg, gif, bmp, png

Some use preload resources, while others do not (because binary files may be accidentally changed)

<Project>... <build>... <resources> <resource> <directory> src/main/resources </directory> resource folder <filtering> true </filtering> use <shortdes> <include> **/*. xml </include> files used </includes> </resource> <directory> src/main/resources </directory> <filtering> false </filtering> NO use <excludes> <exclude> **/*. xml </exclude> remove the used </excludes> </resource>... </resources>... </build>... </project>

Specify $ {} not to replace, that is, escape: escapeString =\, will become \ $ {}

The change will be replaced with the variable content format:

<Delimiters> <delimiter >$ {*} </delimiter> * content will be replaced by <delimiter >@</delimiter> </delimiters>

Process-test-resources: Test resource not copied: skip = true

6. test: A file is output by default. You can specify the output to the screen:

<plugin>   <groupId>org.apache.maven.plugins</groupId>   <artifactId>maven-surefire-plugin</artifactId>   <configuration>       <reportFormat>brief</reportFormat>       <useFile>false</useFile>   </configuration></plugin>

Skip the test phase:SkipTests= True

 

More details: http://maven.apache.org/plugins/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.