Author: dennisl Date: Sun Nov 2 17:17:20 2014 New Revision: 1636154 URL: http://svn.apache.org/r1636154 Log: Rewrite the usage page.
Added: maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt.vm - copied, changed from r1636147, maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt Removed: maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt Copied: maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt.vm (from r1636147, maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt) URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt.vm?p2=maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt.vm&p1=maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt&r1=1636147&r2=1636154&rev=1636154&view=diff ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt (original) +++ maven/plugins/trunk/maven-toolchains-plugin/src/site/apt/usage.apt.vm Sun Nov 2 17:17:20 2014 @@ -19,13 +19,69 @@ Usage ------ Milos Kleint + Dennis Lundberg ------ - 2007-10-01 + 2014-11-02 ------ Usage - Brief examples on how to use the toolchains plugin. + Brief examples on how to use the Maven Toolchains Plugin. + +* What is a toolchain? + + A Toolchain is an object that Maven plugins can use to retrieve preconfigured + tools (including location and other information). + + Maven Toolchains Plugin can read which toolchains are available on the user's + computer (as configured in <<<toolchains.xml>>>) and match them against the + toolchain requirements of the project (as configured in <<<pom.xml>>>). If a + match is found, the toolchain is made available to other, toolchain aware, + Maven plugins in the build. A list of which plugins are toolchain aware can be + found in + {{{http://maven.apache.org/guides/mini/guide-using-toolchains.html}this guide}}. + + With the <<<jdk>>> toolchain, for example, instead of being stuck with the JDK + used to run Maven, all plugins can use the same other JDK instance without + hardcoding absolute paths into the <<<pom.xml>>> and without configuring every + plugin that require a path to JDK tools. + +* The <<<toolchains:toolchain>>> goal + + This goal is bound by default to the <<<validate>>> lifecycle phase, the + first phase in the lifecycle. This is necessary so that all the plugins that + are bound to later lifecycle phases are made aware of the available + toolchains. + + That being said, you still need to configure the plugin in your <<<pom.xml>>>. + In order for it to execute, you need to add an execution for it, like this: + ++---+ +<project> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-toolchains-plugin</artifactId> + <version>${project.version}</version> + <configuration> + <!-- Configure your toolchain requirements here --> + </configuration> + <executions> + <execution> + <goals> + <goal>toolchain</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> ++---+ + + You can read more about which standard toolchains are available + {{{./toolchains/index.html}here}}. * Generic Plugin configuration information @@ -38,22 +94,3 @@ Usage * {{{http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html}Plugin Prefix}} [] - -* What is a toolchain? - - A Toolchain is a preconfigured object that Maven plugins can use for tool configuration retrieval (location and other information). - - The toolchains-plugin can read available toolchains on the user's computer (as configured in <<<toolchains.xml>>>) and match them - against the toolchain requirements of the project (as configured in <<<pom.xml>>>): if match is found, the toolchain instance - is made available to other Maven plugins. - - With <<<jdk>>> toolchain, for example, instead of being stuck with the JDK used to run Maven, all plugins can use the same other JDK - instance without hardcoding absolute paths into the <<<pom.xml>>> and without configuring every plugin that require path to JDK tools. - -* The <<<toolchains:toolchain>>> mojo - - This goal is meant to be bound to a lifecycle phase and configured in your <<<pom.xml>>>. In order to function properly, - it shall be the first phase in the lifecycle, eg. the "<<<validate>>>" phase, which - is the default if you don't configure execution phase. - - The available standard toolchains are described {{{./toolchains/index.html}here}}.