diff --git a/maven-site/src/site/apt/ant-tasks.apt b/maven-site/src/site/apt/ant-tasks.apt index 1df2209cb5..340d7240f7 100755 --- a/maven-site/src/site/apt/ant-tasks.apt +++ b/maven-site/src/site/apt/ant-tasks.apt @@ -70,7 +70,7 @@ Using the Antlib ----- - @@ -107,7 +107,7 @@ Using the Antlib You can also specify a <<>> parameter on each dependency. This changes the behaviour of transitive dependencies and is useful for building different types of classpaths. To see how it affects - the behaviour of the dependencies, see the Dependency Mechanism + the behaviour of the dependencies, see the {{{dependencies.html#Dependency_Scope} Dependency Mechanism}} documentation in the Maven 2.0 site. * Declaring Repositories @@ -171,6 +171,8 @@ Using the Antlib * Using a Maven {POM} File + In Maven, the Project Object Model (POM) represents a unit of work - one exists for each artifact that is built. + Maven 2.0 POM files are required for deploying your own artifacts to a repository for use in the dependencies elements of other projects. @@ -191,12 +193,93 @@ Using the Antlib wagon-provider-api 1.0-alpha-2 - ... + + + org.codehaus.modello + modello-core + 1.0-alpha-2-SNAPSHOT + + + + javax.servlet + servlet-api + 2.4 + provided + ----- -~~explain ID + These elements represent: + + * - this is the version of the POM layout in use, currently <<<4.0.0>>> + + * - the group ID represents your organisation and project name, much like a Java package name. + This must be universally unique. This becomes the base directory in the repository as well. + + * - the artifact ID represents the current build unit. It usually equals the filename of the + resulting file, and must be unique within the group. + + * - the version of the artifact you are building. + + * - the artifacts the project is dependant on. + + This is all that is required for most projects. However, it is also possible to use other fields available in + Maven to describe your project, and reference them from your build script. + + To access a POM as Ant properties, you must define it as a reference. For example, to access the version from a POM, + you could use the following: + +----- + + + The version is ${maven.project.version} +----- + + You can also access nested parts of the POM. For example, you can read the default value of the <<>> + element within the <<>> element using a <<<.>>> separator. + +----- + + + The version is ${project.build.directory} +----- + + For more information on the elements available in the POM, see the {{{maven-model/maven.html} descriptor reference}}. + +The Settings File + + The POM can be used to represent most of the information that the tasks have access to, including remote + repositories. For information that is user or environment specific, such as the <<>> tag, are + specified in the <<>> file in Maven, and can be accessed from the Ant tasks also. + + The file is first looked for in <<<$\{user.home\}/.ant/settings.xml>>>, then in <<<$\{user.home\}/.m2/settings.xml>>> + so that the settings can be shared with Maven 2.0 itself. + + For example, to specify your proxy settings, you would specify the following <<>> file: + +----- + + + + http + proxy.host.net + 8080 + localhost + + + +----- + + For more information in configuring <<>>, see: + + * {{{configuration.html} Configuring Maven}}. + + * {{{maven-settings/settings.html} Settings Descriptor Reference}}. + + * There is a + {{{http://svn.apache.org/repos/asf/maven/components/trunk/maven-core/src/conf/settings.xml} sample settings file}} + in the Maven installation. Sample Ant Script @@ -215,8 +298,120 @@ Getting Help * {{{maven-settings/settings.html} Settings Reference}} -~~settings.xml -~~reference -~~exclusions + * {{{maven-model/maven.html} POM Reference}} +Task Reference + +* <<>> + + This task will check if any of the specified dependencies, and their dependencies are missing or updated, and + download them if necessary. The dependencies will be made available as a fileset or path reference. + + The dependencies task accepts the following attributes: + +*-----------------+--------------------------------------------------------+ +| <<>> | If <<>> this displays the results of each dependency resolution and their relationships. Default is . +*-----------------+--------------------------------------------------------+ +| <<>> | The reference ID to store a fileset under of the resolved dependencies. +*-----------------+--------------------------------------------------------+ +| <<>> | The reference ID to store a path under of the resolved dependencies. +*-----------------+--------------------------------------------------------+ + + The task can include the <<>> nested type, in addition to the other shared types explained later. + You must include at least one <<>> element, or a single <<>> element, but not both. + +** <<>> + +*------------------+--------------------------------------------------------+ +| <<>> | The group ID for of the dependency. +*------------------+--------------------------------------------------------+ +| <<>> | The artifact ID for of the dependency. +*------------------+--------------------------------------------------------+ +| <<>> | The version of the dependency. +*------------------+--------------------------------------------------------+ +| <<>> | The type of the dependency. The default is <<>>. +*------------------+--------------------------------------------------------+ +| <<>> | The scope of the usage of the dependency, which affects which of its dependencies are also retrieved. This can be <<>>, <<>>, <<>>, <<>>. +*------------------+--------------------------------------------------------+ + + The dependency can also nest multiple <<>> elements. + +*** <<>> + + An exclusion can be used to prevent the resolution of a particular artifact in the tree of the dependency. + +*------------------+--------------------------------------------------------+ +| <<>> | The group ID for of the dependency to exclude. +*------------------+--------------------------------------------------------+ +| <<>> | The artifact ID for of the dependency to exclude. +*------------------+--------------------------------------------------------+ + +* <<>> + + This task will install the given file into the local repository. It is stored using the information in the supplied + POM. + +*------------------+--------------------------------------------------------+ +| <<>> | The file to install in the local repository. +*------------------+--------------------------------------------------------+ + + The task must also take a nested <<>>, and can have an optional <<>> element. + +* <<>> + + This task will deploy the given file into the remote repository. It is stored using the information in the supplied + POM. + +*------------------+--------------------------------------------------------+ +| <<>> | The file to deploy in the remote repository. +*------------------+--------------------------------------------------------+ + + The task must also take a nested <<>>, and can have an optional <<>> element. If no + <<>> element is given, the <<>> section of the POM is used. + +Type Reference + +* <<>> + + Specifies the location of the local repository of artifacts. + +*------------------+--------------------------------------------------------+ +| <<>> | The directory of the local repository. +*------------------+--------------------------------------------------------+ +| <<>> | The layout of the local repository. The valid options are <<>> (Maven 1), or <<>> (Maven 2). +*------------------+--------------------------------------------------------+ + +* <<>> + + Specifies the location of the remote repository. + +*----------------------+--------------------------------------------------------+ +| <<>> | The URL of the repository. +*----------------------+--------------------------------------------------------+ +| <<>> | The layout of the remote repository. The valid options are <<>> (Maven 1), or <<>> (Maven 2). +*----------------------+--------------------------------------------------------+ +| <<>> | How often to check for updates on dependencies with a version that includes <<>>. Valid values are <<>>, <<>>, <<>> (, <<>>. +*----------------------+--------------------------------------------------------+ +| <<>> | How to treat missing or incorrect checksums for the dependencies that are downloaded. Valid values are <<>> () and <<>>. +*----------------------+--------------------------------------------------------+ + + The remote repository can also nest the following elements: <<>> and <<>>. + +** <<>> + + The proxy element is typically used for HTTP repositories. The layout is the same as in the + {{{maven-settings/settings.html#Proxy} settings reference}}. + +** <<>> + + The authentication element is used for passing a username, password and other credentials to the repository either + on upload or download. The layout is the same as in the {{{maven-settings/settings.html#Server} settings reference}}. + +* <<>> + + The POM element will load a POM file and make it available as a reference for the other tasks or as properties. + +*------------------+--------------------------------------------------------+ +| <<>> | The file of the POM to load. +*------------------+--------------------------------------------------------+