Maven - Overview

What is Maven?

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. Development team can automate the project’s build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
In case of(万一;如果发生;假设) multiple development teams environment, Maven can set-up the way to work as per standards in a very short time. As most of the project setups are simple and reusable, Maven makes life of developer easy while creating reports, checks, build and testing automation setups.
Maven provides developers ways to manage following:

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution
  • mailing list

To summarize, Maven simplifies and standardizes the project build process. It handles compilation(n. 编辑), distribution(n. 分布;分配), documentation, team collaboration(n. 合作;勾结;通敌) and other tasks seamlessly. Maven increases reusability and takes care of most of build related tasks.

Maven History

Maven was originally designed to simplify building processes in Jakarta Turbine project. There were several projects and each project contained slightly different ANT build files. JARs were checked into CVS.
Apache group then developed Maven which can build multiple projects together, publish projects information, deploy projects, share JARs across several projects and help in collaboration of teams.

Maven Objective

Maven primary goal is to provide developer

  • A comprehensive model for projects which is reusable, maintainable, and easier to comprehend(vt. 理解;包含;由…组成).
  • plugins or tools that interact with this declarative(adj. 宣言的;陈述的,说明的) model.

Maven project structure and contents are declared in an xml file, pom.xml referred as Project Object Model (POM), which is the fundamental unit of the entire Maven system.

Convention over Configuration

Maven uses Convention over Configuration which means developers are not required to create build process themselves.
Developers do not have to mention each and every configuration detail. Maven provides sensible default behavior for projects. When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.
As an example, following table shows the default values for project source code files, resource files and other configurations. Assuming, ${basedir} denotes the project location:

ItemDefault
source code${basedir}/src/main/java
resources${basedir}/src/main/resources
Tests${basedir}/src/test
Complied byte code${basedir}/target
distributable JAR${basedir}/target/classes

In order to build the project, Maven provides developers options to mention life-cycle goals and project dependencies (that rely on Maven pluging capabilities and on its default conventions). Much of the project management and build related tasks are maintained by Maven plugins.
Developers can build any given Maven project without need to understand how the individual plugins work. Refer to Maven Plug-ins section for more detail.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好,以下是 xml-maven-plugin 的官方文档: xml-maven-plugin ============== The XML Maven Plugin provides goals to manipulate XML files. Goals Overview -------------- * `transform`: Transforms an XML file using XSLT. It supports both a file and directory as input and output. Usage ----- ### `transform` goal Transforms an XML file using XSLT. It supports both a file and directory as input and output. #### Parameters * `source`: The source XML file or directory. If a directory is specified, all files in the directory matching the `includes` and `excludes` parameters will be processed. * `output`: The output file or directory. If a directory is specified, the output file names will be derived from the input file names, by replacing the original file extension with the one specified in the `extension` parameter. If no `extension` is specified, the original file extension will be kept. * `stylesheet`: The XSLT stylesheet to apply. * `includes`: Comma-separated list of file name patterns to include. The default is `**/*.xml`. * `excludes`: Comma-separated list of file name patterns to exclude. The default is nothing. * `extension`: The file extension to use for the output files. If not specified, the original file extension will be kept. #### Example ```xml <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xml-maven-plugin</artifactId> <version>1.0</version> <executions> <execution> <id>transform-xml</id> <phase>package</phase> <goals> <goal>transform</goal> </goals> <configuration> <source>src/main/resources/xml</source> <output>${project.build.directory}/transformed-xml</output> <stylesheet>src/main/resources/xslt/transform.xslt</stylesheet> <includes>*.xml</includes> <excludes>example.xml</excludes> <extension>.html</extension> </configuration> </execution> </executions> </plugin> ``` This example transforms all XML files in the `src/main/resources/xml` directory, except for `example.xml`, using the `src/main/resources/xslt/transform.xslt` stylesheet, and outputs the results to the `${project.build.directory}/transformed-xml` directory, with the `.html` extension.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值