Class Settings
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.maven.resolver.internal.ant.types.Settings
- All Implemented Interfaces:
Cloneable
public class Settings
extends org.apache.tools.ant.types.DataType
Represents Maven settings for repository resolution in Ant builds.
This data type allows configuration of user-specific and global Maven settings.xml files,
typically used to define mirrors, proxies, authentication, and repository policies.
It can be defined inline or as a reference using refid.
Only one of each settings file (user or global) may be set unless using a reference.
Example usage:
<settings file="${user.home}/.m2/settings.xml"/>
- See Also:
-
Field Summary
Fields inherited from class org.apache.tools.ant.types.DataType
checked, refFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFile()Gets the user-level Maven settings file, usually~/.m2/settings.xml.Gets the global-level Maven settings file, typically defined by the installation.protected SettingsgetRef()Resolves this object if defined as a reference and verifies that it is aSettingsinstance.voidSets the user-level Maven settings file.voidsetGlobalFile(File globalFile) Sets the global-level Maven settings file.voidsetRefid(org.apache.tools.ant.types.Reference ref) Marks this instance as a reference to anotherSettingsdefinition.Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toStringMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
Settings
public Settings()Default constructor forSettingsdata type.
-
-
Method Details
-
getRef
Resolves this object if defined as a reference and verifies that it is aSettingsinstance.- Returns:
- the referenced
Settingsinstance - Throws:
org.apache.tools.ant.BuildException- if the reference is invalid
-
setRefid
public void setRefid(org.apache.tools.ant.types.Reference ref) Marks this instance as a reference to anotherSettingsdefinition.When using a reference, no other attributes (e.g.,
file,globalFile) may be set.- Overrides:
setRefidin classorg.apache.tools.ant.types.DataType- Parameters:
ref- the Ant reference to anotherSettingselement- Throws:
org.apache.tools.ant.BuildException- if attributes are already set
-
getFile
Gets the user-level Maven settings file, usually~/.m2/settings.xml.- Returns:
- the user settings file
-
setFile
Sets the user-level Maven settings file.This file is typically located at
~/.m2/settings.xml.- Parameters:
file- the user settings file
-
getGlobalFile
Gets the global-level Maven settings file, typically defined by the installation.- Returns:
- the global settings file
-
setGlobalFile
Sets the global-level Maven settings file.This file typically resides in the Maven installation directory under
conf/settings.xml.- Parameters:
globalFile- the global settings file
-