| ~~ Licensed to the Apache Software Foundation (ASF) under one |
| ~~ or more contributor license agreements. See the NOTICE file |
| ~~ distributed with this work for additional information |
| ~~ regarding copyright ownership. The ASF licenses this file |
| ~~ to you under the Apache License, Version 2.0 (the |
| ~~ "License"); you may not use this file except in compliance |
| ~~ with the License. You may obtain a copy of the License at |
| ~~ |
| ~~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~~ |
| ~~ Unless required by applicable law or agreed to in writing, |
| ~~ software distributed under the License is distributed on an |
| ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~~ KIND, either express or implied. See the License for the |
| ~~ specific language governing permissions and limitations |
| ~~ under the License. |
| |
| ------ |
| JDK Toolchain |
| ------ |
| Milos Kleint |
| ------ |
| 2007-10-01 |
| ------ |
| |
| Toolchain Identification |
| |
| The toolchain type id for JDK is "<<<jdk>>>". |
| |
| Predefined identification tokens are: |
| |
| * "<<<version>>>" marks the version of the jdk. Maven Toolchains Plugin can match against a single version or any version ranges, |
| |
| * any other tokens will be accepted, but only exact matches are supported. |
| |
| Toolchain Configuration |
| |
| There is only one configuration element named "<<<jdkHome>>>". It designates the root directory |
| of JDK installation. |
| |
| |
| Sample <<<toolchains.xml>>> setup: |
| |
| +---+ |
| <toolchains> |
| <toolchain> |
| <type>jdk</type> |
| <provides> |
| <version>1.5</version> |
| <vendor>sun</vendor> |
| <id>for_mevenide</id> |
| </provides> |
| <configuration> |
| <jdkHome>/home/mkleint/javatools/jdk</jdkHome> |
| </configuration> |
| </toolchain> |
| [...] |
| </toolchains> |
| +---+ |
| |
| |
| Toolchains Plugin Configuration |
| |
| For selection of toolchain for use by the project, the following conditions are matched |
| against the definitions in the <<<toolchains.xml>>> file: |
| |
| * "<<<version>>>" which accepts any {{{/plugins/maven-enforcer-plugin/rules/versionRanges.html}version range definitions}}. |
| Version declared by the toolchain needs to fit into the range, |
| |
| * any other tokens needs exact match. Toolchain not providing such token will not be selected. |
| |
| All conditions need to be satisfied in a sucessfully matched toolchain. |
| |
| |
| Sample Plugin Configuration |
| |
| +---+ |
| <project> |
| [...] |
| <plugins> |
| <build> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-toolchains-plugin</artifactId> |
| <version>${project.version}</version> |
| <executions> |
| <execution> |
| <goals> |
| <goal>toolchain</goal> |
| </goals> |
| </execution> |
| </executions> |
| <configuration> |
| <toolchains> |
| <jdk> |
| <version>[1.5,)</version> |
| </jdk> |
| </toolchains> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| [...] |
| </project> |
| +---+ |