2
DependencyFileSets Task
9
~~ Licensed to the Apache Software Foundation (ASF) under one
10
~~ or more contributor license agreements. See the NOTICE file
11
~~ distributed with this work for additional information
12
~~ regarding copyright ownership. The ASF licenses this file
13
~~ to you under the Apache License, Version 2.0 (the
14
~~ "License"); you may not use this file except in compliance
15
~~ with the License. You may obtain a copy of the License at
17
~~ http://www.apache.org/licenses/LICENSE-2.0
19
~~ Unless required by applicable law or agreed to in writing,
20
~~ software distributed under the License is distributed on an
21
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
~~ KIND, either express or implied. See the License for the
23
~~ specific language governing permissions and limitations
26
~~ NOTE: For help with the syntax of this file, see:
27
~~ http://maven.apache.org/doxia/references/apt-format.html
29
DependencyFilesets Task
31
This task will create fileset objects containing the Maven project dependencies. This can be used access
32
specific dependency artifacts, or to operate on a set of dependency artifacts. Each artifact will be assigned
33
a fileset ID in the form <<<[prefix]groupId:artifactId:[classifier]:type>>>. A dependency on a junit jar would be
34
given a fileset ID of <<<junit:junit:jar>>>.
36
In addition, a single fileset containing all the project dependencies will be created using the default ID
37
maven.project.dependencies
41
*---------------+--------------------------------------------------------+-----------------------------------*
42
|| Attribute || Description || Required |
43
*---------------+--------------------------------------------------------+-----------------------------------*
44
| prefix | String to prepend to all fileset IDs | No, defaults to empty string |
45
*---------------+--------------------------------------------------------+-----------------------------------*
46
| projectDependenciesId | RefId for the fileset containing all project dependencies | No, defaults to "maven.project.dependencies |
47
*---------------+--------------------------------------------------------+-----------------------------------*
48
| scopes | Comma separated list of artifact scopes to include | No, defaults to all artifacts |
49
*---------------+--------------------------------------------------------+-----------------------------------*
50
| types | Comma separated list of artifact types to include | No, defaults to all artifacts |
51
*---------------+--------------------------------------------------------+-----------------------------------*
56
This example shows how to access individual dependencies and the combined dependency fileset.
60
<groupId>org.apache.maven.plugins</groupId>
61
<artifactId>maven-antrun-plugin</artifactId>
62
<version>${project.version}</version>
65
<id>copy-dependencies</id>
66
<phase>package</phase>
73
<dependencyfilesets prefix="mydeps."/>
74
<mkdir dir="target/dependencies"/>
75
<copy todir="target/dependencies">
76
<fileset refid="mydeps.junit:junit:jar"/>
77
<fileset refid="mydeps.org.apache.ant:ant:jar"/>
80
<mkdir dir="target/dependencies2"/>
81
<copy todir="target/dependencies2" flatten="true">
82
<fileset refid="mydeps.maven.project.dependencies"/>