| ------ |
| Using Maven Toolchains |
| ------ |
| Akom <akom> |
| ------ |
| 2020-04-17 |
| ------ |
| |
| ~~ 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. |
| |
| ~~ NOTE: For help with the syntax of this file, see: |
| ~~ http://maven.apache.org/doxia/references/apt-format.html |
| |
| For general information about Maven Toolchains, see |
| {{{https://maven.apache.org/guides/mini/guide-using-toolchains.html}Guide to Using Toolchains}} |
| |
| |
| Using Maven Toolchains with ${thisPlugin}. |
| |
| By default, if the pom configures the toolchains plugin as specified in the aforementioned |
| guide, ${thisPlugin} will launch the test jvm using the main toolchain |
| configured in Maven. |
| |
| In some cases, it may be desirable to compile and test using different jvms. |
| While the <<<jvm>>> option can achieve this, it requires hardcoding system-specific paths. |
| Configuration option <<<jdkToolchain>>> can be used to supply an alternate toolchain specification. |
| |
| * Configuring a different jvm for running tests using toolchains |
| |
| +---+ |
| <configuration> |
| [...] |
| <jdkToolchain> |
| <version>1.11</version> |
| <vendor>zulu</vendor> |
| </jdkToolchain> |
| [...] |
| </configuration> |
| +---+ |
| |
| The above example assumes that your toolchains.xml contains a valid entry with these values. |