Clean mdo schemas (#1365)

* fix namespace location
* remove unneeded CDATA
* code formatting
* use {@code xxx}
* generate location tracking classes
* add location tracking to toolchain model
* Fix javadoc
This commit is contained in:
Guillaume Nodet 2024-02-07 22:28:01 +01:00 committed by GitHub
parent c813320848
commit c88afd470f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 480 additions and 899 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,20 +18,20 @@ under the License.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 http://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xml.namespace="http://maven.apache.org/LIFECYCLE/${version}"
xml.schemaLocation="http://maven.apache.org/xsd/lifecycle-${version}.xsd">
<id>lifecycle</id>
<name>Lifecycle</name>
<description><![CDATA[
<description>
Configuration of custom lifecycle mappings for the plugin, as generally stored in
<code>META-INF/maven/lifecycle.xml</code> in a plugin's jar artifact.
]]></description>
{@code META-INF/maven/lifecycle.xml} in a plugin's jar artifact.
</description>
<classes>
<class rootElement="true" xml.tagName="lifecycles" xsd.compositor="sequence">
<name>LifecycleConfiguration</name>
<version>1.0.0</version>
<description><![CDATA[Root element of the <code>lifecycle.xml</code> file.]]></description>
<description>Root element of the {@code lifecycle.xml} file.</description>
<fields>
<field>
<name>lifecycles</name>
@ -46,9 +46,7 @@ under the License.
<class>
<name>Lifecycle</name>
<version>1.0.0</version>
<description><![CDATA[
A custom lifecycle mapping definition.
]]></description>
<description>A custom lifecycle mapping definition.</description>
<fields>
<field>
<name>id</name>

View File

@ -24,7 +24,7 @@ under the License.
<id>plugin</id>
<name>PluginDescriptor</name>
<description><![CDATA[
Maven 4 Plugin descriptor, stored in <code>META-INF/maven/plugin.xml</code> in a plugin's jar artifact.
Maven 4 Plugin descriptor, stored in {@code META-INF/maven/plugin.xml} in a plugin's jar artifact.
This descriptor is generally using the information contained in the annotations of the plugin api.
<p>An XSD is available at <a href="https://maven.apache.org/xsd/plugin-2.0.0.xsd">https://maven.apache.org/xsd/plugin-2.0.0.xsd</a></p>
]]></description>
@ -32,7 +32,7 @@ under the License.
<class rootElement="true" xml.tagName="plugin" xdoc.anchorName="plugin">
<name>PluginDescriptor</name>
<version>1.0.0+</version>
<description><![CDATA[Root element of the <code>plugin.xml</code> file.]]></description>
<description>Root element of the {@code plugin.xml} file.</description>
<fields>
<field>
<name>name</name>
@ -140,9 +140,7 @@ under the License.
<class xdoc.anchorName="mojo">
<name>MojoDescriptor</name>
<version>1.0.0+</version>
<description><![CDATA[
A Mojo description.
]]></description>
<description>A Mojo description.</description>
<fields>
<field>
<name>goal</name>
@ -179,12 +177,12 @@ under the License.
<name>phase</name>
<version>1.0.0+</version>
<type>String</type>
<description><![CDATA[
<description>
Defines a default phase to bind a Mojo execution to if the user does not explicitly set a phase in the POM.
<i>Note:</i> This will not automagically make a Mojo run when the plugin declaration is added
to the POM. It merely enables the user to omit the <code>&lt;phase&gt;</code> element from the
surrounding <code>&lt;execution&gt;</code> element.
]]></description>
&lt;p>&lt;b>Note:&lt;/b> This will not automagically make a Mojo run when the plugin declaration is added
to the POM. It merely enables the user to omit the {@code &lt;phase&gt;} element from the
surrounding {@code &lt;execution&gt;} element.&lt;/p>
</description>
</field>
<field>
<name>executePhase</name>
@ -209,48 +207,48 @@ under the License.
<version>1.0.0/1.1.0</version>
<type>String</type>
<defaultValue>runtime</defaultValue>
<description><![CDATA[
<description>
Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can
execute: <code>compile</code>, <code>runtime</code>, <code>test</code>,
<code>compile+runtime</code> (since Maven 3.0) or <code>runtime+system</code> (since Maven 3.0)
]]></description>
execute: {@code compile}, {@code runtime}, {@code test},
{@code compile+runtime} (since Maven 3.0) or {@code runtime+system} (since Maven 3.0)
</description>
</field>
<field>
<name>dependencyResolution</name>
<version>2.0.0+</version>
<type>String</type>
<defaultValue>runtime</defaultValue>
<description><![CDATA[
<description>
Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can
execute: <code>compile</code>, <code>runtime</code>, <code>test</code>,
<code>compile+runtime</code> (since Maven 3.0) or <code>runtime+system</code> (since Maven 3.0)
]]></description>
execute: {@code compile}, {@code runtime}, {@code test},
{@code compile+runtime} (since Maven 3.0) or {@code runtime+system} (since Maven 3.0)
</description>
</field>
<field>
<name>requiresDependencyCollection</name>
<version>1.0.0/1.1.0</version>
<type>String</type>
<description><![CDATA[
<description>
Flags this Mojo as requiring information about the dependencies that would make up the specified class
path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values.
The important difference is this will not resolve the files for the dependencies, i.e. the artifacts
associated with a Maven project can lack a file. As such, this annotation is meant for Mojos that only
want to analyze the set of transitive dependencies, in particular during early lifecycle phases where
full dependency resolution might fail due to projects which haven't been built yet.
]]></description>
</description>
</field>
<field>
<name>dependencyCollection</name>
<version>2.0.0+</version>
<type>String</type>
<description><![CDATA[
<description>
Flags this Mojo as requiring information about the dependencies that would make up the specified class
path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values.
The important difference is this will not resolve the files for the dependencies, i.e. the artifacts
associated with a Maven project can lack a file. As such, this annotation is meant for Mojos that only
want to analyze the set of transitive dependencies, in particular during early lifecycle phases where
full dependency resolution might fail due to projects which haven't been built yet.
]]></description>
</description>
</field>
<field>
<name>requiresDirectInvocation</name>
@ -325,7 +323,8 @@ under the License.
<description>
Marks this Mojo as being thread-safe, i.e. the Mojo safely supports concurrent execution during parallel
builds. Mojos without this annotation will make Maven output a warning when used during a parallel build
session. Since Maven 3.0.
session.
@since Maven 3.0.
</description>
<defaultValue>false</defaultValue>
</field>
@ -347,9 +346,9 @@ under the License.
<name>executionStrategy</name>
<version>1.0.0/1.1.0</version>
<type>String</type>
<description><![CDATA[
Specify the execution strategy: <code>once-per-session</code>, <code>always</code>.
]]></description>
<description>
Specify the execution strategy: {@code once-per-session}, {@code always}.
</description>
<defaultValue>once-per-session</defaultValue>
</field>
<field>
@ -362,10 +361,10 @@ under the License.
<name>deprecated</name>
<version>1.0.0+</version>
<type>String</type>
<description><![CDATA[
Description with the reason of Mojo deprecation. Similar to Javadoc <code>@deprecated</code>
<description>
Description with the reason of Mojo deprecation. Similar to Javadoc {@code @deprecated}
This will trigger a warning when a user tries to use a Mojo marked as deprecated.
]]></description>
</description>
</field>
<field>
<name>configurator</name>
@ -466,15 +465,15 @@ under the License.
<version>1.0.0+</version>
<type>boolean</type>
<defaultValue>true</defaultValue>
<description><![CDATA[
<description>
Specifies that this parameter can be configured directly by the user (as in the case of POM-specified
configuration). This is useful when you want to force the user to use common POM elements rather than
plugin configurations, as in the case where you want to use the artifact's final name as a parameter. In
this case, you want the user to modify <code>&lt;build&gt;&lt;finalName/&gt;&lt;/build&gt;</code> rather
this case, you want the user to modify {@code &lt;build&gt;&lt;finalName/&gt;&lt;/build&gt;} rather
than specifying a value for finalName directly in the plugin configuration section. It is also useful to
ensure that - for example - a List-typed parameter which expects items of type Artifact doesn't get a List
full of Strings.
]]></description>
</description>
</field>
<field>
<name>description</name>
@ -492,10 +491,10 @@ under the License.
<name>deprecated</name>
<version>1.0.0+</version>
<type>String</type>
<description><![CDATA[
Description with the reason of parameter deprecation. Similar to Javadoc <code>@deprecated</code>
<description>
Description with the reason of parameter deprecation. Similar to Javadoc {@code @deprecated}.
This will trigger a warning when a user tries to configure a parameter marked as deprecated.
]]></description>
</description>
</field>
<field>
<name>expression</name>

View File

@ -61,6 +61,7 @@ under the License.
<params>
<param>packageModelV4=org.apache.maven.api.settings</param>
<param>locationTracking=true</param>
<param>generateLocationClasses=true</param>
</params>
</configuration>
</execution>

View File

@ -19,8 +19,8 @@
under the License.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd"
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xml.namespace="http://maven.apache.org/SETTINGS/${version}"
xml.schemaLocation="http://maven.apache.org/xsd/settings-${version}.xsd">
<id>settings</id>
@ -30,7 +30,7 @@
<p>This is a reference for the user-specific configuration for Maven.</p>
<p>Includes things that should not be distributed with the pom.xml file, such as developer identity, along with
local settings, like proxy information.</p>
<p>The default location for the settings file is <i>~/.m2/settings.xml</i></p>
<p>The default location for the settings file is {@code ~/.m2/settings.xml}.</p>
]]>
</description>
<defaults>
@ -49,9 +49,8 @@
</description>
<codeSegments>
<codeSegment>
<version>1.0.0+</version>
<version>1.0.0/1.3.0</version>
<code>
<![CDATA[
public static final String USER_LEVEL = "user-level";
public static final String PROJECT_LEVEL = "project-level";
public static final String GLOBAL_LEVEL = "global-level";
@ -59,28 +58,20 @@
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 ) || PROJECT_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
{
throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + PROJECT_LEVEL + "," + GLOBAL_LEVEL + "}" );
}
else
{
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) || PROJECT_LEVEL.equals(sourceLevel) || GLOBAL_LEVEL.equals(sourceLevel))) {
throw new IllegalArgumentException("sourceLevel must be one of: {" + USER_LEVEL + "," + PROJECT_LEVEL + "," + GLOBAL_LEVEL + "}");
} else {
this.sourceLevel = sourceLevel;
this.sourceLevelSet = true;
}
}
public String getSourceLevel()
{
public String getSourceLevel() {
return sourceLevel;
}
]]>
</code>
</codeSegment>
</codeSegments>
@ -90,9 +81,8 @@
<superClass>TrackableBase</superClass>
<version>1.0.0+</version>
<description>
<![CDATA[
Base class for <code>Mirror</code>, <code>Profile</code>, <code>Proxy</code> and <code>Server</code>.
]]></description>
Base class for {@code Mirror}, {@code Profile}, {@code Proxy} and {@code Server}.
</description>
<fields>
<field>
<name>id</name>
@ -117,7 +107,7 @@
<required>true</required>
<description>
<![CDATA[
The local repository.<br><b>Default value is:</b> <code>${user.home}/.m2/repository</code>
The local repository.<br><b>Default value is:</b> {@code ${user.home}/.m2/repository}
]]>
</description>
<type>String</type>
@ -126,9 +116,7 @@
<name>interactiveMode</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Whether Maven should attempt to interact with the user for input.
]]>
</description>
<type>boolean</type>
<defaultValue>true</defaultValue>
@ -137,60 +125,30 @@
<name>usePluginRegistry</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Whether Maven should use the plugin-registry.xml file to manage plugin versions.
]]>
</description>
<type>boolean</type>
<defaultValue>false</defaultValue>
</field>
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
<!-- field>
<name>passwordStore</name>
<version>1.0.0+</version>
<required>false</required>
<description><![CDATA[The keystore used to store passwords.]]></description>
<type>String</type>
</field -->
<field>
<name>offline</name>
<version>1.0.0+</version>
<required>false</required>
<description>
<![CDATA[
Indicate whether maven should operate in offline mode full-time.
]]>
</description>
<type>boolean</type>
<defaultValue>false</defaultValue>
</field>
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
<!-- field>
<name>jdks</name>
<version>1.0.0+</version>
<description><![CDATA[
Configuration for different java environment profiles. One good use
for this might be to configure both JDK 1.4 and JDK 1.5 to work with
maven. Profiles will allow switching of entire java environments
based on the profile id, either in the defaults section below, or on
the command line.
]]></description>
<association>
<type>Jdk</type>
<multiplicity>*</multiplicity>
</association>
</field -->
<field xdoc.separator="blank">
<name>proxies</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Configuration for different proxy profiles. Multiple proxy profiles
might come in handy for anyone working from a notebook or other
mobile platform, to enable easy switching of entire proxy
configurations by simply specifying the profile id, again either from
the command line or from the defaults section below.
]]>
</description>
<association>
<type>Proxy</type>
@ -201,11 +159,9 @@
<name>servers</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Configuration of server-specific settings, mainly authentication
method. This allows configuration of authentication on a per-server
basis.
]]>
</description>
<association>
<type>Server</type>
@ -227,9 +183,7 @@
<name>repositories</name>
<version>1.3.0+</version>
<description>
<![CDATA[
The lists of the remote repositories.
]]>
</description>
<association>
<type>Repository</type>
@ -240,30 +194,24 @@
<name>pluginRepositories</name>
<version>1.3.0+</version>
<description>
<![CDATA[
The lists of the remote repositories for discovering plugins.
]]>
</description>
<association>
<type>Repository</type>
<multiplicity>*</multiplicity>
</association>
<comment>
<![CDATA[
This may be removed or relocated in the near
future. It is undecided whether plugins really need a remote
repository set of their own.
]]>
</comment>
</field>
<field xdoc.separator="blank">
<name>profiles</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Configuration of build profiles for adjusting the build
according to environmental parameters.
]]>
</description>
<association>
<type>Profile</type>
@ -274,10 +222,8 @@
<name>activeProfiles</name>
<version>1.0.0+</version>
<description>
<![CDATA[
List of manually-activated build profiles, specified in the order in which
they should be applied.
]]>
</description>
<association>
<type>String</type>
@ -302,115 +248,87 @@
<version>1.0.0/1.3.0</version>
<code>
<![CDATA[
public Boolean getInteractiveMode()
{
return Boolean.valueOf( isInteractiveMode() );
public Boolean getInteractiveMode() {
return Boolean.valueOf(isInteractiveMode());
}
private Proxy activeProxy;
/**
* Reset the <code>activeProxy</code> field to <code>null</code>
* Reset the {@code activeProxy} field to {@code null}.
*/
public void flushActiveProxy()
{
public void flushActiveProxy() {
this.activeProxy = null;
}
/**
* @return the first active proxy
*/
public synchronized Proxy getActiveProxy()
{
if ( activeProxy == null )
{
public synchronized Proxy getActiveProxy() {
if (activeProxy == null) {
java.util.List<Proxy> proxies = getProxies();
if ( proxies != null && !proxies.isEmpty() )
{
for ( Proxy proxy : proxies )
{
if ( proxy.isActive() )
{
if (proxies != null && !proxies.isEmpty()) {
for (Proxy proxy : proxies) {
if (proxy.isActive()) {
activeProxy = proxy;
break;
}
}
}
}
return activeProxy;
}
public Server getServer( String serverId )
{
public Server getServer(String serverId) {
Server match = null;
java.util.List<Server> servers = getServers();
if ( servers != null && serverId != null )
{
for ( Server server : servers )
{
if ( serverId.equals( server.getId() ) )
{
if (servers != null && serverId != null) {
for (Server server : servers) {
if (serverId.equals(server.getId())) {
match = server;
break;
}
}
}
return match;
}
@Deprecated
public Mirror getMirrorOf( String repositoryId )
{
public Mirror getMirrorOf(String repositoryId) {
Mirror match = null;
java.util.List<Mirror> mirrors = getMirrors();
if ( mirrors != null && repositoryId != null )
{
for ( Mirror mirror : mirrors )
{
if ( repositoryId.equals( mirror.getMirrorOf() ) )
{
if (mirrors != null && repositoryId != null) {
for (Mirror mirror : mirrors) {
if (repositoryId.equals(mirror.getMirrorOf())) {
match = mirror;
break;
}
}
}
return match;
}
private java.util.Map<String, Profile> profileMap;
/**
* Reset the <code>profileMap</code> field to <code>null</code>
* Reset the {@code profileMap} field to {@code null}
*/
public void flushProfileMap()
{
public void flushProfileMap() {
this.profileMap = null;
}
/**
* @return a Map of profiles field with <code>Profile#getId()</code> as key
* @see Profile#getId()
* @return a Map of profiles field keyed by {@link Profile#getId()}
*/
public java.util.Map<String, Profile> getProfilesAsMap()
{
if ( profileMap == null )
{
public java.util.Map<String, Profile> getProfilesAsMap() {
if (profileMap == null) {
profileMap = new java.util.LinkedHashMap<String, Profile>();
if ( getProfiles() != null )
{
for ( Profile profile : getProfiles() )
{
profileMap.put( profile.getId(), profile );
if (getProfiles() != null) {
for (Profile profile : getProfiles()) {
profileMap.put(profile.getId(), profile);
}
}
}
return profileMap;
}
]]>
@ -418,46 +336,13 @@
</codeSegment>
</codeSegments>
</class>
<!-- @todo: is any of this too CVS specific? Investigate other SCMs -->
<!-- [JC] Commenting out until we're ready to use it... -->
<!-- class>
<name>Jdk</name>
<version>1.0.0+</version>
<superClass>TrackableBase</superClass>
<description><![CDATA[Describes one Java environment]]></description>
<fields>
<field>
<name>active</name>
<version>1.0.0+</version>
<required>false</required>
<defaultValue>false</defaultValue>
<description><![CDATA[Whether this JDK is the active one.]]></description>
<type>boolean</type>
</field>
<field>
<name>version</name>
<version>1.0.0+</version>
<required>true</required>
<description><![CDATA[The JDK major version (eg. '1.4').]]></description>
<type>String</type>
</field>
<field>
<name>javaHome</name>
<version>1.0.0+</version>
<required>true</required>
<description><![CDATA[The JDK home.]]></description>
<type>String</type>
</field>
</fields>
</class -->
<class>
<name>Proxy</name>
<version>1.0.0+</version>
<superClass>IdentifiableBase</superClass>
<description>
<![CDATA[
The <code>&lt;proxy&gt;</code> element contains informations required to a proxy settings.
]]></description>
The {@code &lt;proxy&gt;} element contains information required to a proxy settings.
</description>
<fields>
<field xml.tagName="active">
<name>activeString</name>
@ -475,9 +360,7 @@
<name>protocol</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The proxy protocol.
]]>
</description>
<type>String</type>
<defaultValue>http</defaultValue>
@ -486,9 +369,7 @@
<name>username</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The proxy user.
]]>
</description>
<type>String</type>
</field>
@ -496,9 +377,7 @@
<name>password</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The proxy password.
]]>
</description>
<type>String</type>
</field>
@ -517,9 +396,7 @@
<name>host</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The proxy host.
]]>
</description>
<type>String</type>
<required>true</required>
@ -528,9 +405,7 @@
<name>nonProxyHosts</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The list of non-proxied hosts (delimited by |).
]]>
</description>
<type>String</type>
</field>
@ -592,17 +467,14 @@
<version>1.0.0+</version>
<superClass>IdentifiableBase</superClass>
<description>
<![CDATA[
The <code>&lt;server&gt;</code> element contains informations required to a server settings.
]]></description>
The {@code &lt;server&gt;} element contains information required to a server settings.
</description>
<fields>
<field>
<name>username</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The username used to authenticate.
]]>
</description>
<type>String</type>
</field>
@ -610,9 +482,7 @@
<name>password</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The password used in conjunction with the username to authenticate.
]]>
</description>
<type>String</type>
</field>
@ -620,9 +490,7 @@
<name>privateKey</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The private key location used to authenticate.
]]>
</description>
<type>String</type>
</field>
@ -630,9 +498,7 @@
<name>passphrase</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The passphrase used in conjunction with the privateKey to authenticate.
]]>
</description>
<type>String</type>
</field>
@ -640,9 +506,7 @@
<name>filePermissions</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The permissions for files when they are created.
]]>
</description>
<type>String</type>
</field>
@ -650,9 +514,7 @@
<name>directoryPermissions</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The permissions for directories when they are created.
]]>
</description>
<type>String</type>
</field>
@ -660,9 +522,7 @@
<name>configuration</name>
<type>DOM</type>
<description>
<![CDATA[
Extra configuration for the transport layer.
]]>
</description>
</field>
</fields>
@ -706,7 +566,8 @@
<version>1.1.0+</version>
<type>String</type>
<defaultValue>default</defaultValue>
<description>The layout of the mirror repository. Since Maven 3.</description>
<description>The layout of the mirror repository.
@since Maven 3.</description>
</field>
<field>
<name>mirrorOfLayouts</name>
@ -715,7 +576,8 @@
<defaultValue>default,legacy</defaultValue>
<description>
The layouts of repositories being mirrored. This value can be used to restrict the usage
of the mirror to repositories with a matching layout (apart from a matching id). Since Maven 3.
of the mirror to repositories with a matching layout (apart from a matching id).
@since Maven 3.
</description>
</field>
<field>
@ -734,19 +596,17 @@
<code>
<![CDATA[
public String toString()
{
StringBuilder sb = new StringBuilder( 128 );
sb.append( "Mirror[" );
sb.append( "id=" ).append( this.getId() );
sb.append( ",mirrorOf=" ).append( this.getMirrorOf() );
sb.append( ",url=" ).append( this.getUrl() );
sb.append( ",name=" ).append( this.getName() );
if ( isBlocked() )
{
sb.append( ",blocked" );
public String toString() {
StringBuilder sb = new StringBuilder(128);
sb.append("Mirror[");
sb.append("id=").append(this.getId());
sb.append(",mirrorOf=").append(this.getMirrorOf());
sb.append(",url=").append(this.getUrl());
sb.append(",name=").append(this.getName());
if (isBlocked()) {
sb.append(",blocked");
}
sb.append( "]" );
sb.append("]");
return sb.toString();
}
]]>
@ -760,20 +620,14 @@
<version>1.0.0+</version>
<superClass>IdentifiableBase</superClass>
<description>
<![CDATA[
Modifications to the build process which is keyed on some
sort of environmental parameter.
]]>
Modifications to the build process which is keyed on some sort of environmental parameter.
</description>
<fields>
<field>
<name>activation</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The conditional logic which will automatically
trigger the inclusion of this profile.
]]>
The conditional logic which will automatically trigger the inclusion of this profile.
</description>
<association>
<type>Activation</type>
@ -782,11 +636,8 @@
<field>
<name>properties</name>
<description>
<![CDATA[
Extended configuration specific to this profile goes here.
Contents take the form of
<code>&lt;property.name&gt;property.value&lt;/property.name&gt;</code>
]]>
Contents take the form of {@code &lt;property.name&gt;property.value&lt;/property.name&gt;}
</description>
<type>Properties</type>
<association xml.mapStyle="inline">
@ -798,9 +649,7 @@
<name>repositories</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The lists of the remote repositories.
]]>
</description>
<association>
<type>Repository</type>
@ -811,20 +660,16 @@
<name>pluginRepositories</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The lists of the remote repositories for discovering plugins.
]]>
</description>
<association>
<type>Repository</type>
<multiplicity>*</multiplicity>
</association>
<comment>
<![CDATA[
This may be removed or relocated in the near
future. It is undecided whether plugins really need a remote
repository set of their own.
]]>
</comment>
</field>
</fields>
@ -833,10 +678,8 @@
<name>Activation</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The conditions within the build runtime environment which will trigger
the automatic inclusion of the parent build profile.
]]>
</description>
<fields>
<field>
@ -852,18 +695,14 @@
<version>1.0.0+</version>
<type>String</type>
<description>
<![CDATA[
Specifies that this profile will be activated when a matching JDK is detected.
]]>
</description>
</field>
<field>
<name>os</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Specifies that this profile will be activated when matching OS attributes are detected.
]]>
</description>
<association>
<type>ActivationOS</type>
@ -873,9 +712,7 @@
<name>property</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Specifies that this profile will be activated when this property is specified.
]]>
</description>
<association>
<type>ActivationProperty</type>
@ -885,9 +722,7 @@
<name>file</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Specifies that this profile will be activated based on existence of a file.
]]>
</description>
<association>
<type>ActivationFile</type>
@ -902,19 +737,15 @@
<version>1.0.0+</version>
<superClass>IdentifiableBase</superClass>
<description>
<![CDATA[
Repository contains the information needed
for establishing connections with remote repository
]]>
</description>
<fields>
<field>
<name>name</name>
<version>1.0.0+</version>
<description>
<![CDATA[
Human readable name of the repository.
]]>
</description>
<type>String</type>
</field>
@ -922,9 +753,7 @@
<name>url</name>
<version>1.0.0+</version>
<description>
<![CDATA[
The url of the repository.
]]>
</description>
<type>String</type>
</field>
@ -947,13 +776,11 @@
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals( Object obj )
{
public boolean equals(Object obj) {
RepositoryBase other = (RepositoryBase) obj;
boolean retValue = false;
if ( this.getId() != null )
{
retValue = this.getId().equals( other.getId() );
if (this.getId() != null) {
retValue = this.getId().equals(other.getId());
}
return retValue;
}
@ -1002,9 +829,8 @@
/**
* @see RepositoryBase#equals(java.lang.Object)
*/
public boolean equals( Object obj )
{
return super.equals( obj );
public boolean equals(Object obj) {
return super.equals(obj);
}
]]>
</code>
@ -1053,11 +879,9 @@
<name>ActivationProperty</name>
<version>1.0.0+</version>
<description>
<![CDATA[
This is the property specification used to activate a profile. If the value field is empty,
then the existence of the named property will activate the profile, otherwise it does a case-sensitive
match against the property value as well.
]]>
</description>
<fields>
<field>
@ -1083,10 +907,8 @@
<name>ActivationOS</name>
<version>1.0.0+</version>
<description>
<![CDATA[
This is an activator which will detect an operating system's attributes in order to activate
its profile.
]]>
</description>
<fields>
<field>
@ -1102,8 +924,7 @@
<version>1.0.0+</version>
<type>String</type>
<description>
The general family of the OS to be used to activate a
profile (e.g. 'windows')
The general family of the OS to be used to activate a profile (e.g. 'windows')
</description>
</field>
<field>
@ -1128,11 +949,9 @@
<name>ActivationFile</name>
<version>1.0.0+</version>
<description>
<![CDATA[
This is the file specification used to activate a profile. The missing value will be a the location
This is the file specification used to activate a profile. The missing value will be the location
of a file that needs to exist, and if it doesn't the profile must run. On the other hand exists will test
for the existence of the file and if it is there will run the profile.
]]>
</description>
<fields>
<field>
@ -1140,8 +959,7 @@
<version>1.0.0+</version>
<type>String</type>
<description>
The name of the file that should be missing to activate a
profile.
The name of the file that should be missing to activate a profile.
</description>
</field>
<field>
@ -1165,13 +983,11 @@
<codeSegment>
<version>2.0.0+</version>
<code>
<![CDATA[
@Override
public String toString() {
return getLineNumber() + " : " + getColumnNumber() + ", " + getSource();
}
]]>
</code>
</codeSegment>
</codeSegments>
@ -1185,9 +1001,7 @@
<version>2.0.0+</version>
<type>String</type>
<description>
<![CDATA[
The path/URL of the settings definition or {@code null} if unknown.
]]>
</description>
</field>
</fields>
@ -1195,12 +1009,10 @@
<codeSegment>
<version>2.0.0+</version>
<code>
<![CDATA[
@Override
public String toString() {
return getLocation();
}
]]>
</code>
</codeSegment>
</codeSegments>

View File

@ -59,6 +59,8 @@ under the License.
</templates>
<params>
<param>packageModelV4=org.apache.maven.api.toolchain</param>
<param>locationTracking=true</param>
<param>generateLocationClasses=true</param>
</params>
</configuration>
</execution>

View File

@ -19,24 +19,24 @@
under the License.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.0.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.0.0.xsd"
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.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>
This is a reference for the Maven Toolchains descriptor.
<p>The default location for the toolchains file is {@code ~/.m2/toolchains.xml}
<p>A Toolchain is a preconfigured object that Maven plugins can use for tool configuration retrieval (location and other information).
<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>):
and match them against the toolchain requirements of the project (as configured in {@code pom.xml}):
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>
<p>With {@code 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 {@code pom.xml}
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>
@see <a href="/guides/mini/guide-using-toolchains.html">Guide to Using Toolchains</a>
]]></description>
<defaults>
@ -51,12 +51,11 @@
<name>TrackableBase</name>
<version>1.1.0+</version>
<description>
common base class that contains code to track the source for
this instance (USER|GLOBAL)
Common base class that contains code to track the source for this instance (USER|GLOBAL)
</description>
<codeSegments>
<codeSegment>
<version>1.1.0+</version>
<version>1.1.0/1.1.0</version>
<code>
<![CDATA[
public static final String USER_LEVEL = "user-level";
@ -65,25 +64,18 @@
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
{
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()
{
public String getSourceLevel() {
return sourceLevel;
}
]]>
@ -94,16 +86,16 @@
<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>
<description>
The {@code &lt;toolchains&gt;} element is the root of the descriptor.
The following table lists all 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>
<description>The toolchain instance definition.</description>
<association xml.itemsStyle="flat">
<type>ToolchainModel</type>
<multiplicity>*</multiplicity>
@ -122,13 +114,13 @@
<version>1.0.0+</version>
<!-- <identifier>true</identifier> -->
<description>
<![CDATA[Type of toolchain:<ul>
<li><code>jdk</code> for
<a href="https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK Standard Toolchain</a>,</li>
<li>other value for
<a href="https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom Toolchain</a></li>
</ul>
]]></description>
Type of toolchain:&lt;ul>
&lt;li>{@code jdk} for &lt;a
href="https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK Standard Toolchain&lt;/a>,&lt;/li>
&lt;li>other value for &lt;a
href="https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom Toolchain&lt;/a>&lt;/li>
&lt;/ul>
</description>
<type>String</type>
</field>
<field>
@ -136,12 +128,12 @@
<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>
Toolchain identification information, which will be matched against project requirements.
&lt;p>Actual content structure is completely open: each toolchain type will define its own format and
semantics.
&lt;p>This is generally a properties format: {@code &lt;name&gt;value&lt;/name&gt;} with predefined
properties names.
</description>
</field>
<field>
<name>provides</name>
@ -153,74 +145,55 @@
</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>
Toolchain identification information, which will be matched against project requirements.
&lt;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. This was generally a properties format.
&lt;p>Since Maven 3.2.4, the type for this field has been changed to Properties to match the de-facto
format.
&lt;p>Each toolchain defines its own properties names and semantics.
</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 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
per-toolchain defined properties names.</p>
]]></description>
Toolchain configuration information, like location or any information that is to be retrieved.
&lt;p>Actual content structure is completely open: each toolchain type will define its own format and
semantics.
&lt;p>In general, this is a properties format: {@code &lt;name&gt;value&lt;/name&gt;} with per-toolchain
defined properties names.
</description>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>1.2.0+</version>
<comment>Generated hashCode() and equals() based on identifier also calls its super, which breaks comparison</comment>
<comment>Generated hashCode() and equals() based on identifier also calls its super, which breaks comparison
</comment>
<code>
<![CDATA[
/**
* Method hashCode.
*
* @return int
* Computes a hash value based on {@link #getType()} and {@link #getProvides()} values.
*/
public int hashCode()
{
int result = 17;
result = 37 * result + ( getType() != null ? getType().hashCode() : 0 );
result = 37 * result + ( getProvides() != null ? getProvides().hashCode() : 0 );
return result;
public int hashCode() {
return java.util.Objects.hash(getType(), getProvides());
} //-- int hashCode()
/**
* Method equals.
*
* @param other
* @return boolean
* Checks equality based on {@link #getType()} and {@link #getProvides()} values.
*/
public boolean equals( Object other )
{
if ( this == other )
{
public boolean equals(Object other) {
if (this == other) {
return true;
}
if ( !( other instanceof ToolchainModel ) )
{
} else if (!(other instanceof ToolchainModel)) {
return false;
}
} else {
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 )
return java.util.Objects.equals(this.getType(), that.getType())
&& java.util.Objects.equals(this.getProvides(), that.getProvides());
}
} //-- boolean equals(Object)
]]>
</code>
</codeSegment>

View File

@ -17,8 +17,8 @@ specific language governing permissions and limitations
under the License.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd">
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd">
<id>extension</id>
<name>ExtensionDescriptor</name>
<description><![CDATA[

View File

@ -20,10 +20,10 @@ under the License.
<model>
<id>remoteResourcesBundle</id>
<name>RemoteResourcesBundle</name>
<description><![CDATA[
<description>
A bundle of remote resources.
This is the model specification for remote-resources.xml.
]]></description>
</description>
<defaults>
<default>
<key>package</key>
@ -39,9 +39,9 @@ under the License.
<field>
<name>remoteResources</name>
<version>1.1.0</version>
<description><![CDATA[
<description>
Remote resources that are contained in a remote resources bundle.
]]></description>
</description>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@ -50,9 +50,9 @@ under the License.
<field>
<name>sourceEncoding</name>
<version>1.1.0</version>
<description><![CDATA[
<description>
Source encoding of the remote resources contained in the bundle.
]]></description>
</description>
<type>String</type>
</field>
</fields>

View File

@ -20,8 +20,8 @@
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd"
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xml.namespace="http://maven.apache.org/EXTENSIONS/${version}"
xml.schemaLocation="http://maven.apache.org/xsd/core-extensions-${version}.xsd">

View File

@ -17,8 +17,8 @@ specific language governing permissions and limitations
under the License.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd"
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xml.namespace="http://maven.apache.org/METADATA/${version}"
xml.schemaLocation="https://maven.apache.org/xsd/repository-metadata-${version}.xsd">
<id>repository-metadata</id>
@ -69,7 +69,7 @@ under the License.
<name>version</name>
<version>1.0.0+</version>
<type>String</type>
<description><![CDATA[The base version (ie. ending in <code>-SNAPSHOT</code>) when this directory represents a "groupId/artifactId/version" for a SNAPSHOT.]]></description>
<description>The base version (i.e. ending in {@code -SNAPSHOT}) when this directory represents a "groupId/artifactId/version" for a SNAPSHOT.</description>
</field>
<field xdoc.separator="blank">
<name>plugins</name>

View File

@ -81,6 +81,7 @@ under the License.
</templates>
<params combine.children="append">
<param>locationTracking=true</param>
<param>generateLocationClasses=true</param>
</params>
</configuration>
</execution>

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.api.settings;
package ${package};
import java.io.Serializable;
import java.util.Collection;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.api.settings;
package ${package};
public interface InputLocationTracker {
InputLocation getLocation(Object field);

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.api.settings;
package ${package};
import java.io.Serializable;

View File

@ -31,10 +31,18 @@
#set ( $dummy = $allFields.addAll( $cl.getFields($version) ) )
#end
#set ( $className = "${class.name}" )
#if ( $locationTracking && $generateLocationClasses )
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/InputLocation.java
#parse ( "java/InputLocation.java" )
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/InputLocationTracker.java
#parse ( "java/InputLocationTracker.java" )
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/InputSource.java
#parse ( "java/InputSource.java" )
#end
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/ImmutableCollections.java
#parse ( "java/ImmutableCollections.java" )
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java
#if ( $class.name != "InputLocation" && $class.name != "InputSource" )
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')}/${className}.java
#set ( $types = { } )
#set ( $imports = $class.getClass().forName("java.util.TreeSet").newInstance() )
#set ( $dummy = $imports.add( "java.io.Serializable" ) )