From: http://www.jieesoft.com/modules.php? Name = News & File = Article & SID = 155
Maven and Ant are the famous Build and Engineering Management Tools launched by Apache. Some people in China have worked hard, and launched the Maven manual Hanhua work, which has been completed, and the majority of programmers can help. Enter the website user manual
About manual introduction project object model POM processing mechanism
POM interpolation mechanism POM inheritance mechanism uses plug-in maven.xml file
Simple Maven.xml Example Project Node Target Jelly Programming Maven Configuration
Property of the Property Processing Machine Plugin Property Behavior Properties Using Agents Using Multiple Remote Repositories Project Settings
Start a new project building
Building a lifecycle In CVS, stock JAR files overload the declared dependent package Use Snapshot Relationship with multi-project build and Reactor Offline build command line options introduction test
Test resource running a separate test package
JAR resource deployment
Curing Snapshot Dependent Copy Relying on JAR Package Name Contributions
Rules and Guide Projects Relying on Project Remote Repository Layout Local Repository Layout Generating Project Site
Color style report
About the manual This Maven manual is intended to help developers understand Maven by providing complete descriptions and examples. If you have any suggestions or comments, please publish it on the Maven user mailing list. Thanks for choosing maven! Maven first starts with the Jarkarta Turbine project, the purpose is to simplify the build process. There are several sub-projects below this project, and each sub-project has its own ANT file, but the difference is small, and the generated JAR file is check in to CVS. We want to have a standard way to build these items, a way to clearly describe the project, a way to publish project information, a way to share JARS between multiple items. This result is a project that can be used to build and manage any Java based. We hope that this tool we created allows the daily work of Java developers to make it easier and helps understand Java-based projects. The project object model Maven is created based on the concept of the project object model (POM). In this model, all Artifact generated by Maven is the result of a clearly defined project model. Build, document, source code metrics, source cross-references, and anything provided by Maven Plug-in are controlled by the POM. POM processing mechanism This document describes how to handle POM during Maven execution. There are some simple POM examples to display inheritance mechanisms and interpolation mechanisms. POM interpolation mechanism POM (usually in project.xml's name) is now being processed as Jelly scripts. Most of the time, users do not have to care about the Project.xml file is not a real Jelly script, but if necessary, the built-in value can also be used. I also don't want to see the logic control statement in Project.xml, but because Project.xml is actually an implied Jelly script, it will have enough flexibility :-). Here is a simple example. 3 Maven Maven Maven 1.0-b5-dev apache software followation http://jakarta.apache.org/ /images/jakarta-logo-blue.gif 2001 org.apache. $ {Pom.ArtifactID} / images / $ {pom. ArtifactID} .jpg maven is a project what Was created in $ {pom. "{pom.name} Is a Java Project Management Tool POM Inheritance Mechanism Now there is a simple way to inherit in the POM, below A simple example: Project.xml super-extendo super-extendo super extendo ** / * test * .java ** / testall.java ** / * Abstract * .java is currently relatively weak to the PM parent object. Now no test has been done over a layer of inheritance. Despite this, single-layer inheritance plus interpolation mechanism has been able to bring a lot of benefits. The intent of these mechanisms is to simplify the shared problems of the construction.
You can define the main template like this: 3 Commons Commons-Master Commons Master Maven Pom apache software Foundation http://www.apache.org jakarta http://jakarta.apache.org/commons/$ $p.pom.ArtifactID }.html http : //nagoya.apache.org/ jakarta.apache.org / www/jakarta.apache.org/commons/resnda.org/jakarta.apache.org/builds/jakarta-commons/resi / $ 帖.artifactid} / SCM: CVS: PSERVER: Anoncvs@cvs.apache.org: / home / cvspublic: jakarta-commons / $ {pom.ArtifactId} http://cvs.apache.org/viewcvs/jakarta-commons/res {POM.ArtifactID} / ... sub-POM objects can be defined in this way: Commons-Betwixt Commons-BetWixt BetWixt ... You can replace $ {pom.artifactID} of the child POM object in the parent POM object. There are many projects build in a similar way, so that for the public part of the project, you can use a master template, and then define the difference between the sub-POM object Project.xml, and this part of the content Usually very little. This mechanism can indeed simplify those items that need to produce multiple JAR packages. Since Project.xml and standard ANT buildings do not interfere with each other, I plan to inherit the mechanism in public partial testing. If you use this mechanism, the DVSL report will become puzzled, I want to say, you very up. I have modified the DVSL report to adapt to the POM itself, this is how DVSL conversions are based on Java objects. This is necessary when using inheritance and interpolation mechanisms, in order to correct DVSL reports, this is necessary. If the child template listed above is uncomfortable, we need a comprehensive analysis of POM. What I can say is that it can work! The way I use may not be the most efficient way, but there is still an improved space. Because the POM will only be handled once (no matter what, this is the principle, I may miss something), then use it everywhere, at least this is what I have tried to do, so we are likely to get a balance. If you don't use inheritance and interpolation, you work as usual. The Maven site itself is OK, there are several sites that have just been deployed have been filed last night. Using a plugin Maven is a very compact core that surrounds it is a lot of plugins. All functions of Maven are provided by plugins. The Maven.xml file in the Maven.xml file project is the "custom" file you want to use during the execution process. In this file, you can join additional processing you need in Maven build. Or attach your own code before and after Maven's "target", such as JAR or TEST. Maven uses Jelly script languages, any legal Jelly tab can be used in Maven.xml. The Goal function used by Maven is provided by the WERKZ tag library. For more information, please see the Wiki page. Simple maven.xml example Note that because Maven has not defined the 'Compile' target, the following example cannot run.
This is a simple maven.xml example $ {goals} now attaining goal number $ {goalNumber}, what IS $ {GOAL} You may notice some interesting things here, let's explain one by one. The Project Node Project Node, is the root node of any Maven.xml file. The project node has a default attribute: default = "nightly-build", if the user just simply typed the maven command without parameters, Maven will use the Nightly-Build target as the default target. Next is a few namespace statements, such as: XMLns: J = "Jelly: Core" All nodes as a prefix, Jelly will treat it as a predefined tag library under the Core identity. All nodes of U: as a prefix are all nodes, Jelly as a prefix, and Jelly will treat it as a predefined tag library under the identifier. All Jelly tag libraries used in Maven.xml files must be defined in the Project node and assign a namespace prefix. Maven has pre-included the Jeez tag library as an air prefix. This tag library contains Ant and Werkz tag libraries in a namespace. In this way, no WERKZ or ANT tag can be used by namespace, and simplify Ant's migration process. Target Goal is a WERKZ tag, similar to Ant's target; it is a container containing a series of executable labels. Since the JEEZ tag library has been registered by Maven, a goal (Goal) can contain any legal Ant tags. In order to perform the target defined in Maven.xml, you only need to specify the target name for Maven in the command line. To perform the Nightly-build you defined in the example you only need to execute the command: Maven nightly-build maven plugin definition The target needs to add a plug-in before the target, so that you will not conflict with your own Goal, such as Jar: JAR is the target defined by the JAR plugin to create a JAR package for the project. Jelly programming in each target, providing features by Jelly tags, let's take a look at the code in the example. Set this line is a Jelly's Core tag set, which uses the prefix J: Set tag defined in the Project node sets a jelly variable defined by the VAR attribute, and the value is specified by value. Different from Anties, Jelly variables can still change after being assigned. MKDIR is equivalent to the Ant task MKDir, used to create a directory, the directory name is specified by the variable $ {maven.build.dir}. Tokenize $ {Goals} This line is executed Jelly tokenize tag. This is the label in the Jelly Util tag library. This tag library has predefined in the project node: u: Tokenize tags are separated into one LIST in the node for subsequent processing.
The VAR attribute is the variable that will be placed in the new List. The Delim property is a separator used to split strings. In this example, the node value in the Tokenize tag is a variable: Goals, in the first few lines, this is a comma separated, Compile and Test strings.
FOREACH NOW Attaining Goal Number $ {goalNumber}, Which is $ {goal} Foreach tag provides simple loop feature, the node value is a cyclic body.
The items attribute is an expression that is a collection of values that need to be traversed during the loop. The values in the collection are taken out one by one, stored in the variables specified in the VAR attribute. You can access this variable in the Foreach cycle. The Indexvar property specifies a counter (starting group 0) variable for counting during processing. The node value of the Foreach label outputs some text about the target during the process, and use the Attackoal Werkz tag to get (execute?) these goals. The process mechanism of the Maven configuration properties Maven reads the Properties file in order in the order below:
$ {project.home} /project.properties $ {project.home} /build.properties $ {user.home} /build.properties
The read attribute follows the "final definition valid" principle. That is, Maven reads the Properties file in turn to overwrite the old definitions in a new definition. $ {user.home} /build.properties is the last process of Maven. We call these files as the standard attribute file set for Maven processing. In addition, the above Properties file is processed, Maven will begin processing system properties. So, if you use the form of -dproperty = value in the command line to specify the properties, it overrides the previously defined same name properties. After the attribute file of the plug-in, Maven will only call the plugin, but the pluginManager disables the plugin to overwrite the value of the settings already set. This is the opposite of the Maven's general attribute processing mode, because the plug-in can only be handled after the other parts of Maven, but we hope to deal with properties in this order:
Processing Plug-in Default Properties Processing $ {Project.home} /Project.properties Processing $ {Project.home} /Build.Properties Processing $ {User.home} /build.properties
In this way, even if the plugin is in the rear end of the attribute processing chain, any default attributes of the plugin can be overwritten. For example, the CheckStyle plugin defines the following default attribute: maven.checkstyle.format = Sun You may have guess, the checksytle plugin puts the Sun's encoding specification as the default format. But we can still overwrite this property in any file of the standard properties file set. So if you define the following property values in the $ {project.home} /project.properties file: maven.checkstyle.format = Turbine Checkstyle uses Turbine coding specifications. These properties below the Behavior Attribute can change Maven "behavior". Property Description Default value maven.build.dest directory name, store compilation and generated class $ {maven.build.dir} / classes maven.build.dir stores the directory of build results, such as class files, documents, unit test reports, etc. . Note: Change the default value of Maven.build.dir in $ {user.home} /build.properties file may get a more personalized directory layout. However, this will interfere with the compilation of the Maven from the source code because it assumes that the JAR package is created to the $ {basedir} / target / directory. $ {basedir} / target maven.build.src Source Code $ {Maven.build.dir} / src maven.conf.dir configuration file directory $ {basedir} / conf maven.docs.dest HTML format report output directory $ { Maven.build.dir} / DOCS Maven.docs.MITXMLDeclaration The XML declarative head, such as: false maven.docs.outputencoding Generate Documentation ISO-8859-1 Maven.docs.src users Document Directory $ {baseDir} / xdocs maven.gen.docs xdocs document converted to HTML Output Directory $ {Maven.build.dir} / generated-xdocs maven.home.local Maven to write to user information Directory, such as unlocked plugins, buffer data. $ {user.home} /. Maven maven.mode.online Whether to connect Internet True Maven.plugin.dir plug-in storage directory $ {maven.home} / plugins maven.plugin.unpacked.dir is used to expand the directory of the installation plugin $ {Maven.home.local} / plugins maven.repo.central When performing dist: deploy processing, the target machine to deploy to deploy login.ibiblio.org maven.repo.central.directory is in progress DIST: deploy processing To the target directory where the package is to be deployed. / public / html / maven.repo.local REPOSITORY, used to store the downloaded JAR package. $ {maven.home.local} / repository maven.repo.remote Remote repository, if the REPOSTORY is not available, Maven will download here. Http://www.ibiblio.org/maven maven.repo.Remote.NableD uses remote repository.
True maven.scp.executable for secure copy of executable scp maven.src.dir base source code directory $ {basedir} / src maven.ssh.executable Remote Command Executable program SCP Using Agent If you can only access by proxy Don't tighten, Maven provides you with the following properties: Agent Properties Description Maven.Proxy.ust agent's IP address maven.proxy.uSername If the agent needs to be authenticated, fill in the username here. User name if your proxy requires authentication. Maven.proxy.password If the agent needs to be authenticated, fill in the password here. If you really need a proxy, it is best to specify in the $ {user.home} /build.properties file. ## ------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---------- ## $ {user.home} /build.properties ## -------------------------- -------------------------------.. Maven.Proxy.host = my.proxyserver.com maven.proxy.port = 8080 maven.proxy.userName = username maven.proxy.password = password.. Using multiple remote repositories You can specify multiple remote repositories in any Maven can handle, such as: maven.repo.remote = http : //www.ibiblio.org/maven/ ,http://www.mycompany.com/maven/ Project Settings Start a new project If you are using maven, or start a new project, you can use GenApp Create a Maven project tree.
After Maven -Dpackage = com.mycompany.App GenApp executes this command, the screen is displayed as follows: __ __ | / | __ jakarta ___ | | / | / _ v / -_) '~ Intelligent Projects ~ | _ | | ___, _ | _ / ___ | _ || _ | v. 1.0-beta-9 [mkdir] created dir: / gENAP / src / java / com / mycompany / app [Copy] COPYING 1 File to / GenApp / SRC / Java / Com / mycompany / app [mkdir] created dir: / genapp / src / test / com / mycompany / app [COM / SRC / TEST / COM / GENAPP / SRC / TEST / COM / MyCompany / App [COPY] COPYING 2 FILES TO / GENAPP [COPY] COPYING 1 FILE TO / GENAPP / SRC / Conf Build Success ENAP / SRC / CONF Build Success ENTAL TIME: 3 SECONDS is executed, that is, the following full project directory tree:. | - project.properties | - Project.xml `- SRC | - Conf | `- app.properties | - Java |` - com | `- mycompany |` - app | `- app.java` - Test` - com `- mycompany` - App | - Abstract.java. Java | - Apptest.java `- NaughTest.java builds Maven's philosophy of centralized management libraries. All JAR packages for constructing are taken from central libraries centralized management. Currently, our central library is here IBIBLIO. In a typical Maven project, build the JAR package to be downloaded from the center library. Maven will only retrieve the deleted packages on the chain. If you use Maven to build several projects, these items may share some dependencies: Maven can share the same package in any project without having to keep multiple copies of a JAR package in the same system. Building a lifecycle in CVS in CVS, we do not recommend that you save JAR packages in CVS. Maven advocates that in this REPOSTORY is stored in building a shared JAR package or and other item packages. Many projects are dependent on, such as an XML parser, standard routine, which is often replicated in Ant buildings. In MAVEN, these standard routines are stored in local Repository for any project to build. Heavy Dotted Dependent Pack You may find that in some cases, it is convenient to rely on the redeemed contributions that have been declared in the POM, and it is even necessary. You may want to use a JAR package in the file system, or you want to simply reset the version of a package. For this situation, Maven provides a simple way, allowing you to choose the required JAR package. We are seriously suggested;) You set up this machine repository, but JAR package reload feature is very convenient in simply arrival, or in the case of being built by Ant. In order to use JAR package load-bearing features, you must set the maven.jar.Override property to ON. As long as this property is set, you can override the JAR package in any Maven processing properties file. There are two kinds of instructions on JAR overload. The first allows you to specify a particular packet path, as a JAR package; two allow you to specify a particular JAR package (this JAR package must already exist in the native repository).
Below is these two ways: maven.jar.artifactid = [path] maven.jar.ArtifactId = [version] Below is an example of an attribute file using JAR overload instruction: # ----------- -------------------------------------------------- ----------- # Mavenjaroverride # ------------------------------------ ------------------------------------ Maven.jar.Override = on # ------ -------------------------------------------------- ---------------- # jars set explicity by path. # -------------------------------------------------------------------------------------------------------------- -------------------------------------------- Maven.jar. A = $ {Basedir} /lib/a.jar maven.jar.b = $ {basedir} /lib/b.jar # --------------------- -------------------------------------------------- - # Jars set explicity by version. # ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------ Maven.jar.classworlds = 1.0-beta-1 Use Snapshot to depend on Maven, Snapshop It is the latest JAR package for a particular project. If your project relies on another frequently changing project, you can declare Snapshop dependence in your POM to keep synchronization with that project. For example, write this in your POM, you can keep you synchronous update with Jelly. ... Commons-Jelly Commons-Jelly Snapshot ... The meaning of the above statement is: Always use the latest Jelly build pack in Maven Repository. Snapshot depends generally leads to dependence failure. In this case, maven will go to Maven Repository to get a copy of a snapshot dependent package. If you are working offline, Maven will issue a warning: "Snapsho reliance package may have expired." Multi-Project Build and Reactor In Maven, Reactor is a tool for controlling multiple project builds. The Reactor is arranged with the WERKZ package and the dependencies defined according to each project are arranged. Reactor's intention is that it is a project that is less, more loose, and more consistent units. R is derived from component programming. In the component programming, the entire system consists of many loose individuals, which need to be aggregated as an overall deployment. Reactor can perform an arbitrary program list for a project set. So, if you use Reactor, it can be used to generate a project site, any JAR package generates such a thing. At present, DB.apache.org sites are the rich information of their sub-projects and synthesized with a series of Velocity templates. This process is done by Jelly Velocity tag library. Here is the mechanism, interested in see. The manifest of the PLEXUS (a Avalon-based container) component is traversing all plexus components and polygitations. Is it used here or a Velocity Template and Jelly Volocity Tag Library. Here is the mechanism, interested in see.
Here is an example of using the Reactor tag, traversing a series of components, and finally generating project sites: ... do wherever you want with the harvested information ... If you need to aggregate the N project documents, form a unified view, you You can refer to the db.apache.org site, which collects information from all sub-projects, eventually forms a navigation bar, mailing list, developer list, and source repository unified site. This solves redundancy in the process of collecting sub-project, which is easy to generate errors. The subpower of db.apache.org only needs to pay attention to itself, but it can be automatically integrated into the high-level project site. Offline build If you need to build offline, you have to use offline options in the command line: Maven -o jar: jar This is equivalent to: maven -dmaven.mode.online = false jar: jar or you can set Maven in the property file. The Mode.Online property is False. In online mode, Maven always downloads the Snapshot dependent package, please refer to the use of Snapshot. If the current version on the native repository is more new than the server, you may not want Maven to override your current version. If you don't want to download, you can set the properties: maven.repo.remote.enabled = false In the Maven Beta 9 version, this property does not work (the new version has resolved this problem). You can empty the maven.repo.remote property: maven.repo.remote.enabled = settings in the command line or attribute file. In the following circumstances, you need to set up maven.repo.remote.enabled = false maven.mode.online = true: I hope that the "-link" option of the JavadoC plugin works, and I don't want to download any (including the snapshot) package. . The command line option introduces if you build it with the command line, here is provided with a quick reference about the command line option. Options: -d, - define arg Defines a system properties - E, - EMACS output simple log information -X, - debug output debug information -B, - Nobanner disabled LOGO BANNER -D, - DIR ARG settings The specified working directory -E,-exception output exception stack information -F, -Find Arg determines the execution project file and its working directory -H, - Goals displays the available targets - H, - HELP Display Help Information -i, - Info Display System Information-O, - Offline Offline Build -P, - POM Arg Specifying Project Files - V, - Version Display Version Number Test Sources Normally, you need The test class path is specified for the test. You can use the following example in the POM to explain how to recurrently contained in the $ {basedir} / src / test directory all files with .xml and .properties as extensions: ... ... $ { Basedir} / src / test ** / *. xml ** / *. Properties The following example shows how to recurrently contained in the $ {basedir} / src / test directory all files with .xml and .properties as extensions Except for naughty.properties files.
Please pay attention to the increased project / build / unittest / resources / excluded node: ... $ {basedir} / src / test ** / *. Xml ** / *. Properties naughty.properties runs a separate Test The following command runs a separate test: maven -dtestcase = org.foo.bar.mytest test: Single-test package JAR resource ... $ {basedir} / src / conf * .xml * .properties $ { Basedir} / maven / message org / apache / maven / messages messages * .properties Deploy Curing Snapshot Rely on the development of Snapshot rely on the Snapshot dependent package, but when you deploy, you need to fix all the Snapshot dependencies for A version containing fixed jar. If you post a project with a snapshot-dependent package, these snapshot has changed after the project is released, and you may soon discover this version of no way. When Snapshot is deployed to MAVEN at a timestamp, Maven can identify foo-snapshot.jar actually equivalent to Foo-20030101.010101.jar. When the deployment is coming, you can use the following command to turn the Snapshot version number to the timestamp version number. Maven Convert-Snapshots Maven will provide interaction to let you choose which Snapshopt dependent package should be cured. After this process, maven will write your choice to your POM. If you want Maven simple, as best as possible to cure the Snapshot dependent package, you can use the following command: maven converT-snapshots-auto copy dependence on the JAR package to write the following statement this is the simplest copy dependent package Methods. ... Use deploy: Copy-DEPS tab to copy all the dependencies of the project to any directory, if you want to exclude a dependent package, you need to give a list of ID, dependencies in the list. The package will not be copied. ... Naming Conventions This section will make a brief description of the project object model (POM) in the project. This document hopes to unify a wide range of JAR package naming methods, which are generally widely used by Java developer communities. Rule and Guide Project A project must be identified by a unique identifier, identifying the A-Z lowercase letters and connect numbers, and its initial must begin with lowercase letters. BAR FOO ... The references between all items are constructed of group ID and package ID. Up to now, the POM is related to the dependencies of the items that will be discussed below (mentioned above). The name of the project should be easy to read and can be used for documentation. Bar Foo The Grand Master Foo ... project should have a group identity, the group identifier is the base portion of the name. Bar foo the grand master foo
... All items released package should be based on the unique identifier and placed in a directory based on the project-based ID. For the above project, it is assumed that the package is a JAR type package, we will have the following directory structure: repository | - bar | - distribution `- jar | - foo-1.0.jar` - Foo-2.0.jar relying on an ideal example of a typical dependency declaration may like this: YourProject YourRTIFACT YOURTIEGEVE MACHINE ... BAR FOO 1.0, depending on the BAR project that is the ID of the Foo1.0 version belongs to Org.foo. BAR group. This dependency will be parsed to the JAR file in the local Repository. The above situation assumes that the published package is named based on the package ID. Therefore, for the above dependencies, maven will use foo-1.0.jar as JAR name. As users are reflected, this ideal way does not adapt to all items. There are several scenarios that we must consider adjusting the ideal dependency mechanism: The published JAR package does not use the project as the base name, such as XerceSimpl is the foundation name of all published JAR packets. It is different from the ID of the gump ID and maven. The published JAR package does not use any version declaration, such as many Commons components do not use the version number as part of the package name. Some projects do not use the project ID as the base name and there is no version declaration. For example, the worst case is the JAR package of Java Activation Framework. It does not follow other Sun's naming rules, nor did it declare the version number in the JAR package, and even have any version information in Manifest. In most cases, any exception can be used (optional node), or rename it. Now, many Jarkata's products have been renamed in Repository, because in the near future, most Jarkarta projects will be built with Maven. But this is not a company policy, we don't need to solve all the problems. Project Maven released by multiple packages fully supports any form of multi-project packets. Maven's Dependency Mechanism Completely Supports's Multiple Project Artifacts of Any Given Type. The following code contains the main JAR package of Ant and Optional packets plus the Hypothetical package. Ant Ant 1.4.1
Ant Ant-optional 1.4.1 Ant poorly-named 1.4.1 So A), B) and C) In fact, it is actually pointed to a single package belonging to the same group, which means that a separate dependence is in a group. A reference for a package. At present, Artifact If not specifically explained, the JAR package is generally referred to. But dependent may also be a WAR file or a distribution package. We tried to take into account the flexibility while providing the default ways used in most cases (constructing most of the JAR packets). Remote Repository layout This section of the document will make a profile for the remote repositories of Maven. Currently, the master repository is ibiblio, but you can also create a remote repositories yourself, and the result description can be found in this section. Any independent project has its own directory in Repository. Each project has a unique project ID and the same name directory, the project's distribution package is placed in this directory. A variety of Artifacts can be stored in the directory of the project, the most widely used types are the jar package and the release package below is a remote repository snapshot: repository | | - Ant | | - Distribution | `- Jars | | - ANT-1.4.1.jar | `- Ant-optional-1.4.1.jar - JSSE | - Distribution` - Jars | - JSSE.JAR | - JCERT.JAR` - JNET.JAR Local Repository layout should have a compact implementation of an interface collection makes local repository directory structures more casual. Now I only use a class to achieve, it looks a bit bloated. I still think that the local and remote repositories should maintain the same structure but in order to use it, I start to design some interfaces to meet the user's own local Repository layout, similar remote repositor is also in design. Although local Repository is still exactly the same as remote repository, I want to hear more user feedback to promote the development of these interfaces, or completely discard it. Generating a project site Maven can generate a completed Web site for the project. This Web site will contain a variety of reports generated by many Maven plugins such as Javadocs, Code Metrics, Unit Test, CHANGLOG, and Other ... This section of the document will explain the Site customization options supported by Maven. Color takes into account consistency, by default, all of Maven generated sites use similar appearance. This allows the user to recognize the site generated by Maven, producing familiar feelings, more convenient for information acquisition. Of course, the Maven development group also considers that users may want to customize their sites. Modifying the site generated by Maven, the easiest way is to specify the color match you want to use. This only needs to set the appropriate properties in Project.Properties simple settings. Below is all available attributes description in xdoc plugin. Style If you feel that the color is too simple, you can't meet your requirements, you can use your own stylesheet. In order to overload the maven.css stylesheet in $ {basedir} / xdocs / stylesheets /, you can specify your Javadoc style by setting the maven.javadoc.stylesheet property. Finally, if you want to customize which reports need to be automatically generated, you need to include the Reports tag library in your project description. So far, if there is no Reports tag, all plug-in reports will be generated.