现在的位置: 首页 > web前端 > 正文

wed前端开发使用maven-help-plugin查看插件

2019年11月18日 web前端 ⁄ 共 5225字 ⁄ 字号 评论关闭

  除了通过访问在线文档了解某个插件的详细信息外,还可以借助 maven-help-plugin 插件来获取插件的详细信息。比如,在 CMD 命令行窗口中运行如下命令。

  Mvn help:describe -Dplugin=org.apache.maven.plugins:maven-site-plugin:3.4 -Ddetail

  就可以查看到 maven-site-plugin 插件 3.4 版本的详细信息,内容很多,如下列出的是开始的几个基本信息。

  Name: Apache Maven Site Plugin

  Description: The Maven Site Plugin is a plugin that generates a site for the

  current project.

  Group Id: org.apache.maven.plugins

  Artifact Id: maven-site-plugin

  Version: 3.4

  Goal Prefix: site

  This 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

  Name: Apache Maven Site Plugin

  Description: The Maven Site Plugin is a plugin that generates a site for the

  current project.

  Group Id: org.apache.maven.plugins

  Artifact Id: maven-site-plugin

  Version: 3.4

  Goal Prefix: site

  This 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 目标信息。

  Mvn help:describe -Dplugin=site -Dgoal=site -Ddetail

  输出信息:

  [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

  命令中的 -Dplugin=site 通过插件的前缀来指定要查看的插件名称,与写成 -Dplugin=org.apache.maven.plugins:maven-site-plugin:3.6 是一样的意思。

  -Dgoal=site,指定要查看的目标,名称是 site。

  -Ddetail,表示要查看详细信息。

抱歉!评论已关闭.