You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/site/apt/usage.apt.vm
+54-54
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@
13
13
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
14
~~ KIND, either express or implied. See the License for the
15
15
~~ specific language governing permissions and limitations
16
-
~~ under the License.
17
-
16
+
~~ under the License.
17
+
18
18
------
19
19
Usage
20
20
------
@@ -25,20 +25,20 @@
25
25
------
26
26
27
27
Usage
28
-
28
+
29
29
Brief examples on how to use the dependency goals:
30
30
31
31
%{toc|fromDepth=2}
32
-
32
+
33
33
* <<<dependency:copy>>>
34
34
35
35
This goal is meant to be bound to a lifecycle phase and configured in your
36
36
<<<pom.xml>>>. It will resolve the artifact from the repository and place a copy
37
37
in the specified location. Multiple artifacts can be defined in a single
38
38
execution. A default output directory is specified but can be overridden for
39
39
each ArtifactItem by setting the optional outputDirectory field. An
40
-
optional new name can be set to rename or the version stripped while copying.
41
-
40
+
optional new name can be set to rename or the version stripped while copying.
41
+
42
42
The artifact version is optional. If not set, the plugin will attempt to resolve it from the
43
43
project dependencies and then the dependencyManagement section.
44
44
@@ -87,7 +87,7 @@ Usage
87
87
[...]
88
88
</project>
89
89
+---+
90
-
90
+
91
91
If you intend to configure this goal for execution on the command line using:
92
92
93
93
+---+
@@ -128,28 +128,28 @@ mvn dependency:copy
128
128
+---+
129
129
130
130
<Notes:>
131
-
132
-
* By default, artifacts are copied into <outputDirectory> using
131
+
132
+
* By default, artifacts are copied into <outputDirectory> using
133
133
Maven artifact file name convention ( ie <artifactId-version-classifier.type> ).
134
134
Use the following rules to override the default convention:
135
-
136
-
* Use <artifactItem.destFileName> to override the default file name.
137
-
135
+
136
+
* Use <artifactItem.destFileName> to override the default file name.
137
+
138
138
* Use <stripVersion> to remove <version> from default file name.
139
139
This field is ignored when <artifactId.destFileName> is set.
140
-
141
-
* Use <artifactItem.outputDirectory> to override the plugin's <outputDirectory> configuration
140
+
141
+
* Use <artifactItem.outputDirectory> to override the plugin's <outputDirectory> configuration
142
142
per <artifactItem>.
143
-
143
+
144
144
[]
145
-
145
+
146
146
[]
147
147
148
148
* <<<dependency:copy-dependencies>>>
149
149
150
150
This goal can be bound to a lifecycle phase and configured in your <<<pom.xml>>>.
151
151
It will resolve the dependencies (including transitive dependencies) from
152
-
the repository and place a copy in the specified location.
152
+
the repository and place a copy in the specified location.
153
153
154
154
The artifacts can be placed in subfolders based on type. For example:
155
155
@@ -171,7 +171,7 @@ mvn dependency:copy
171
171
<<<mvn dependency:copy-dependencies -Dclassifier=sources>>> will try to find
172
172
the sources for all dependencies and copy them.
173
173
174
-
Also included is the ability to include or exclude by type (war, jar etc), scope (runtime, test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
174
+
Also included is the ability to include or exclude by type (war, jar etc), scope (runtime, test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
175
175
176
176
<<Note:>> As of 2.0-alpha-5, you may mix includes and excludes of the same category (ie scope). Includes are processed before excludes.
177
177
@@ -216,18 +216,18 @@ mvn dependency:copy
216
216
It will resolve the artifact from the repository and place a copy in the
217
217
specified location. Multiple artifacts can be defined in a single execution.
218
218
A default outputDirectory is specified but can be overridden for each
219
-
ArtifactItem by setting the optional outputDirectory field.
220
-
219
+
ArtifactItem by setting the optional outputDirectory field.
220
+
221
221
A single artifact can be unpacked multiple times if different include/exclude parameters
222
222
are defined for each artifactItem
223
223
224
224
See the {{{#Overwrite_Rules}Overwrite Rules}} section for rules about how overwriting is handled.
225
225
226
226
The artifact version is optional. If not set, the plugin will attempt to resolve it from the
227
227
project dependencies and then the dependencyManagement section.
228
-
228
+
229
229
Configure the plugin something like this if you intend to bind it to execute along with your build:
230
-
230
+
231
231
+---+
232
232
<project>
233
233
[...]
@@ -328,15 +328,15 @@ mvn dependency:unpack
328
328
resolve artifacts with the classifier and type. For example:
329
329
<<<mvn dependency:unpack-dependencies -Dclassifier=sources>>> will try to find
330
330
the sources for all dependencies and unpack them.
331
-
331
+
332
332
Filters can be applied to include or exclude certain file or filesets as necessary
333
-
334
-
Also included is the ability to include or exclude by type (war, jar etc), scope (runtime, test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
333
+
334
+
Also included is the ability to include or exclude by type (war, jar etc), scope (runtime, test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
335
335
336
336
<<Note:>> You can mix includes and excludes of the same category (i.e. scope). Includes are processed before excludes.
337
337
338
338
See the {{{#Overwrite_Rules}Overwrite Rules}} section for rules about how overwriting is handled.
339
-
339
+
340
340
The goal can also be launched from the command line like:
Artifacts are copied or unpacked using the following rules:
374
374
375
375
* If the artifact doesn't exist in the destination, then copy/unpack it.
376
-
376
+
377
377
Otherwise:
378
-
378
+
379
379
* For copy/unpack goal only: if <<<artifactItem / overWrite>>> or <<<overWrite>>> is true, then it will force an overwrite.
380
-
380
+
381
381
* Releases check the <<<overWriteReleases>>> value (default = false). If true, then it will force an overwrite.
382
382
383
383
* Snapshots check the <<<overWriteSnapshots>>> value (default = false). If true, then it will force an overwrite.
384
-
384
+
385
385
* If none of the above is set to true, then it defaults to the <<<overWriteIfNewer>>> value (default = true). This value, if true, causes
386
386
the plugin to only copy if the source is newer than the destination (or it doesn't exist in the destination). (for unpack, this checks the existence of the marker file, created in the <<<markersDirectory>>> path.
387
387
To avoid unexpected behavior after <<<mvn clean>>>, this path should normally be contained within the <<</target>>> hierarchy.)
388
-
388
+
389
389
Examples:
390
-
390
+
391
391
* Using the default settings (<<<overWriteReleases>>> = false, <<<overWriteSnapshots>>> = false, <<<overWriteIfNewer>>> = true), then a release or snapshot artifact will
392
392
only over write the destination if the source is newer than the destination (or marker file if unpacking).
393
-
393
+
394
394
* If <<<overWriteReleases>>> = true, then a release artifact (ie <<<foo-1.0.jar>>>) will always overwrite.
395
-
395
+
396
396
* If <<<overWriteSnapshots>>> = true, then a snapshot artifact (ie <<<foo-1.0-SNAPSHOT.jar>>>) will always overwrite.
397
-
397
+
398
398
* If all of the values are false, then a copy/unpack will only occur if it doesn't exist in the destination (or <<<markersDirectory>>> if unpacking).
399
-
400
-
399
+
400
+
401
401
402
402
* <<<dependency:resolve>>>
403
403
@@ -419,15 +419,15 @@ mvn dependency:unpack
419
419
<<<mvn dependency:resolve -Dclassifer=test-jar>>> will try to find the
420
420
test-jar for all dependencies resolve them to the local repository.
421
421
422
-
* <<<dependency:sources>>>
422
+
* <<<dependency:resolve-sources>>>
423
423
424
-
Sources is intended to be used from the command line like:
425
-
<<<mvn dependency:sources -Dsilent=true>>>
424
+
Resolve-sources is intended to be used from the command line like:
<<Note:>> The <<<exclude>>> parameter is a comma-delimited list of
471
+
<<Note:>> The <<<exclude>>> parameter is a comma-delimited list of
472
472
groupId:artifactId pairs. It has a corresponding List-based parameter -
473
473
<<<excludes>>> - for convenient use inside the POM.
474
474
@@ -529,7 +529,7 @@ mvn dependency:analyze
529
529
530
530
* <<<dependency:analyze-dep-mgt>>>
531
531
532
-
This goal looks at the dependencies after final resolution and looks for mismatches in your dependencyManagement section.
532
+
This goal looks at the dependencies after final resolution and looks for mismatches in your dependencyManagement section.
533
533
In versions of maven prior to 2.0.6, it was possible to inherit versions that didn't match your dependencyManagement. See {{{https://issues.apache.org/jira/browse/MNG-1577}MNG-1577}} for more info.
534
534
535
535
If this goal detects issues, you should attempt to resolve the discrepancies before upgrading to 2.0.6 to avoid any surprises. This can be done by upgrading or downgrading the version in dependencyManagement to match what is actually
This goal will output a classpath string of dependencies from the local repository to a file or log and optionally attach and deploy the file. For instance, the file would contain a classpath string like this:
0 commit comments