| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <!-- |
| 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. |
| --> |
| <html> |
| <head> |
| <script type="text/javascript">var xookiConfig = {level: 1};</script> |
| <script type="text/javascript" src="../xooki/xooki.js"></script> |
| </head> |
| <body> |
| <textarea id="xooki-source"> |
| <b>Tag:</b> include |
| |
| <span class="tagdoc" id="ivysettings.include">Includes another ivysettings file as if it were part of this one.</span> <span class="since">since 1.3</span> |
| |
| The included ivysettings file has to be a complete well formed ivysettings file, i.e. it does have to include the <code><ivysettings></code> tag. |
| |
| <h1>Attributes</h1> |
| <table class="ivy-attributes"> |
| <thead> |
| <tr><th class="ivy-att">Attribute</th><th class="ivy-att-desc">Description</th><th class="ivy-att-req">Required</th></tr> |
| </thead> |
| <tbody> |
| <tr><td>url</td><td>a URL to the ivysettings file to include</td> |
| <td>Yes, unless file is specified</td></tr> |
| <tr><td>file</td><td>a path to the ivysettings file to include</td> |
| <td>Yes, unless url is specified</td></tr> |
| <tr><td>optional</td><td>indicates whether Ivy should throw an error if the specified file doesn't exist. <span class="since">(Since 2.4)</span>.</td> |
| <td>No, default to false</td></tr> |
| </tbody> |
| </table> |
| <h1>Examples</h1> |
| <code type="xml"> |
| <ivysettings> |
| <property name="myrepository" value="path/to/my/real/rep"/> |
| <settings defaultResolver="default"/> |
| <include file="path/to/ivysettings-default.xml"/> |
| </ivysettings> |
| </code> |
| with ivysettings-default.xml: |
| <code type="xml"> |
| <ivysettings> |
| <property name="myrepository" value="path/to/rep" overwrite="false"/> |
| <resolvers> |
| <ivyrep name="default" ivyroot="${myrepository}"/> |
| </resolvers> |
| </ivysettings> |
| </code> |
| |
| The included ivysettings defines a resolver named default, which is an ivyrep resolver, with its root configured as being the value of myrepository variable. This variable is given the value path/to/rep in the included file, but because the attribute overwrite is set to false, it will not override the value given in the main ivysettings including this one, so the value used for myrepository will be path/to/my/real/rep. |
| <hr/> |
| <code type="xml"> |
| <ivysettings> |
| <include file="ivysettings-macro.xml"/> |
| <resolvers> |
| <mymacro name="includeworks" mymainrep="included/myrep" mysecondrep="included/secondrep"/> |
| </resolvers> |
| </ivysettings> |
| </code> |
| with ivysettings-macro.xml being the ivysettings example given on the [[settings/macrodef macrodef documentation page]]. |
| This lets us easily reuse the custom macro resolver. |
| </textarea> |
| <script type="text/javascript">xooki.postProcess();</script> |
| </body> |
| </html> |