aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/toolchains.mdo
blob: 830a52756f7f3b4d1477b540d37f59f91b73de4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0"?>

<!--
  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.

-->
<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
  xml.namespace="http://maven.apache.org/TOOLCHAINS/${version}"
  xml.schemaLocation="http://maven.apache.org/xsd/toolchains-${version}.xsd">
    <id>toolchains</id>
    <name>MavenToolchains</name>
    <description><![CDATA[
    <p>This is a reference for the Maven Toolchains descriptor.</p>
    <p>The default location for the toolchains file is <code>~/.m2/toolchains.xml</code></p>
    <p>A Toolchain is a preconfigured object that Maven plugins can use for tool configuration retrieval (location and other information).</p>
    <p>The <a href="/plugins/maven-toolchains-plugin/">toolchains-plugin</a> can read available toolchains on the user's computer
    and match them against the toolchain requirements of the project (as configured in <code>pom.xml</code>):
    if match is found, the toolchain instance is made available to other Maven plugins.</p>
    <p>With <code>jdk</code> 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 <code>pom.xml</code>
    and without configuring every plugin that require path to JDK tools.</p>
    <p>See the <a href="/guides/mini/guide-using-toolchains.html">Guide to Using Toolchains</a> for
    more information.</p>
    ]]></description>

    <defaults>
        <default>
            <key>package</key>
            <value>org.apache.maven.toolchain.model</value>
        </default>
    </defaults>

    <classes>
    <class java.clone="deep">
          <name>TrackableBase</name>
          <version>1.1.0+</version>
          <description>
            common base class that contains code to track the source for
            this instance (USER|GLOBAL)
          </description>
          <codeSegments>
            <codeSegment>
              <version>1.1.0+</version>
              <code>
                <![CDATA[
        public static final String USER_LEVEL = "user-level";
        public static final String GLOBAL_LEVEL = "global-level";

        private String sourceLevel = USER_LEVEL;
        private boolean sourceLevelSet = false;

        public void setSourceLevel( String sourceLevel )
        {
            if ( sourceLevelSet )
            {
                throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
            }
            else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
            {
                throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
            }
            else
            {
                this.sourceLevel = sourceLevel;
                this.sourceLevelSet = true;
            }
        }

        public String getSourceLevel()
        {
            return sourceLevel;
        }
                ]]>
              </code>
            </codeSegment>
          </codeSegments>
        </class>
        <class rootElement="true" xml.tagName="toolchains" xsd.compositor="sequence">
            <name>PersistedToolchains</name>
            <superClass>TrackableBase</superClass>
            <description><![CDATA[
         The <code>&lt;toolchains&gt;</code> element is the root of the descriptor.
         The following table lists all of the possible child elements.
            ]]></description>
            <version>1.0.0+</version>
            <fields>
                <field>
                    <name>toolchains</name>
                    <version>1.0.0+</version>
                    <description><![CDATA[The toolchain instance definition.]]></description>
                    <association xml.itemsStyle="flat">
                        <type>ToolchainModel</type>
                        <multiplicity>*</multiplicity>
                    </association>
                </field>
            </fields>
        </class>
        <class>
            <name>ToolchainModel</name>
            <superClass>TrackableBase</superClass>
            <version>1.0.0+</version>
            <description>Definition of a toolchain instance.</description>
            <fields>
                <field>
                    <name>type</name>
                    <version>1.0.0+</version>
                    <!-- <identifier>true</identifier> -->
                    <description>
                    <![CDATA[Type of toolchain:<ul>
                    <li><code>jdk</code> for
                    <a href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK Standard Toolchain</a>,</li>
                    <li>other value for
                    <a href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom Toolchain</a></li>
                    </ul>
                    ]]></description>
                    <type>String</type>
                </field>
                <field>
                    <name>provides</name>
                    <version>1.0.0/1.0.99</version> <!-- fake upperbound, it's inclusive -->
                    <type>DOM</type> <!-- DOM for Maven 2.0.9/2.3.3 -->
                    <description>
                    <![CDATA[
                    <p>Toolchain identification information, which will be matched against project requirements.</p>
                    <p>Actual content structure is completely open: each toolchain type will define its own format and semantics.</p>
                    <p>In general, this is a properties format: <code>&lt;name&gt;value&lt;/name&gt;</code> with
                    predefined properties names.</p>
                    ]]></description>
                </field>
                <field>
                    <name>provides</name>
                    <version>1.1.0+</version>
                    <type>Properties</type> <!-- Properties for Maven 2.3.4+ -->
                    <association xml.mapStyle="inline">
                      <type>String</type>
                      <multiplicity>*</multiplicity>
                    </association>
                    <!-- <identifier>true</identifier> -->
                    <description>
                    <![CDATA[
                    <p>Toolchain identification information, which will be matched against project requirements.</p>
                    <p>For Maven 2.0.9 to 3.2.3, the actual content structure was completely open: each toolchain type would define its own format and semantics.
                    In general, this was a properties format.</p>
                    <p>Since Maven 3.2.4, the type for this field has been changed to Properties to match the de-facto format.</p>
                    <p>Each toolchain defines its own properties names and semantics.</p>
                    ]]></description>
                </field>
                <field>
                    <name>configuration</name>
                    <version>1.0.0+</version>
                    <type>DOM</type>
                    <description>
                    <![CDATA[
                    <p>Toolchain configuration information, like location or any information that is to be retrieved.</p>
                    <p>Actual content structure is completely open: each toochain type will define its own format and semantics.</p>
                    <p>In general, this is a properties format: <code>&lt;name&gt;value&lt;/name&gt;</code> with
                    per-toolchain defined properties names.</p>
                    ]]></description>
                </field>
            </fields>
            <codeSegments>
            <codeSegment>
              <version>1.1.0+</version>
              <comment>Generated hashCode() and equals() based on identifier also calls its super, which breaks comparison</comment>
              <code>
                <![CDATA[
    /**
     * Method hashCode.
     * 
     * @return int
     */
    public int hashCode()
    {
        int result = 17;

        result = 37 * result + ( type != null ? type.hashCode() : 0 );
        result = 37 * result + ( provides != null ? provides.hashCode() : 0 );

        return result;
    } //-- int hashCode()
    
    /**
     * Method equals.
     * 
     * @param other
     * @return boolean
     */
    public boolean equals( Object other )
    {
        if ( this == other )
        {
            return true;
        }

        if ( !( other instanceof ToolchainModel ) )
        {
            return false;
        }

        ToolchainModel that = (ToolchainModel) other;
        boolean result = true;

        result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) );
        result = result && ( getProvides() == null ? that.getProvides() == null : getProvides().equals( that.getProvides() ) );

        return result;
    } //-- boolean equals( Object )    
                ]]>
              </code>
            </codeSegment>
          </codeSegments>
        </class>
    </classes>
</model>