同样地,maven-site-plugin 插件有两个目标:site 目标,用来生成项目站点;deploy 目标,用来将生成的站点发布到站点服务器上去。Maven 默认将 site 目标绑定在 site 生命周期的 site 阶段;将 deploy 目标绑定在 site 生命周期的 site-deploy 阶段。
...source:jar-no-fork Description: This goal bundles all the sources into a jar archive. This goal functions the same as the jar goal but does not fork the build and is suitable for attaching to the build lifecycle. Implementation: org.apache.maven.plugins.source.SourceJarNoForkMojo Language: java Bound to phase: package...
通过 Bound to phase:package 可以了解到,jar-no-fork 默认绑定的生命周期阶段是 package。
source (Default: 1.5) User property: maven.compiler.source The -source argument for the Java compiler.staleMillis (Default: 0) User property: lastModGranularityMs Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.target (Default: 1.5) User property: maven.compiler.target The -target argument for the Java compiler.
Name: Apache Maven Site PluginDescription: The Maven Site Plugin is a plugin that generates a site for the current project.Group Id: org.apache.maven.pluginsArtifact Id: maven-site-pluginVersion: 3.4Goal Prefix: siteThis plugin has 9 goals:site:attach-descriptor Description: Adds the site descriptor (site.xml) to the list of files to be installed/deployed. For Maven-2.x this is enabled by default only when the project has pom packaging since it will be used by modules inheriting, but this can be enabled for other projects packaging if needed. This default execution has been removed from the built-in lifecycle of Maven 3.x for pom-projects. Users that actually use those projects to provide a common site descriptor for sub modules will need to explicitly define this goal execution to restore the intended behavior. Implementation: org.apache.maven.plugins.site.SiteDescriptorAttachMojo Language: java Bound to phase: package
当然,如果不想查看太多,只是想具体了解插件的某个目标,可以用 -Dgoal=目标的方式查看指定目标的信息,比如运行如下命令,可以查看 site 插件的 site 目标信息。
[INFO] Mojo: 'site:site'site:site Description: Generates the site for a single project. Note that links between module sites in a multi module build will not work, since local build directory structure doesn't match deployed site. Implementation: org.apache.maven.plugins.site.render.SiteMojo Language: java Available parameters: attributes Additional template properties for rendering the site. See Doxia Site Renderer. generatedSiteDirectory (Default: ${project.build.directory}/generated-site) Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time. generateProjectInfo (Default: true) User property: generateProjectInfo Whether to generate the summary page for project reports: project-info.html. generateReports (Default: true) User property: generateReports Convenience parameter that allows you to disable report generation. generateSitemap (Default: false) User property: generateSitemap Generate a sitemap. The result will be a 'sitemap.html' file at the site root. inputEncoding (Default: ${project.build.sourceEncoding}) User property: encoding Specifies the input encoding. locales (Default: en) User property: locales A comma separated list of locales to render. The first valid token will be the default Locale for this site. moduleExcludes Module type exclusion mappings ex: fml -> **/*-m1.fml (excludes fml files ending in '-m1.fml' recursively) The configuration looks like this: filename1.ext,**/*sample.ext changes.xml,navigation.xml outputDirectory (Default: ${project.reporting.outputDirectory}) User property: siteOutputDirectory Directory where the project sites and report distributions will be generated. outputEncoding (Default: ${project.reporting.outputEncoding}) User property: outputEncoding Specifies the output encoding. relativizeDecorationLinks (Default: true) User property: relativizeDecorationLinks Make links in the site descriptor relative to the project URL. By default, any absolute links that appear in the site descriptor, e.g. banner hrefs, breadcrumbs, menu links, etc., will be made relative to project.url. Links will not be changed if this is set to false, or if the project has no URL defined. saveProcessedContent Whether to save Velocity processed Doxia content (*. .vm) to ${generatedSiteDirectory}/processed. siteDirectory (Default: ${basedir}/src/site) Directory containing the site.xml file and the source for hand written docs (one directory per Doxia-source-supported markup types): see Doxia Markup Languages References). skip (Default: false) User property: maven.site.skip Set this to 'true' to skip site generation and staging. templateFile User property: templateFile The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead. validate (Default: false) User property: validate Whether to validate xml input documents. If set to true, all input documents in xml format (in particular xdoc and fml) will be validated and any error will lead to a build failure. xdocDirectory (Default: ${basedir}/xdocs) Alternative directory for xdoc source, useful for m1 to m2 migration Deprecated. use the standard m2 directory layout