Skip to content

Commit d656b03

Browse files
[MDEP-945] Fix documentation about get goal
1 parent 82a9d60 commit d656b03

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

src/main/java/org/apache/maven/plugins/dependency/GetMojo.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public class GetMojo extends AbstractMojo {
105105
private List<ArtifactRepository> pomRemoteRepositories;
106106

107107
/**
108-
* Download transitively, retrieving the specified artifact and all of its dependencies.
108+
* Resolve transitively, retrieving the specified artifact and all of its dependencies.
109109
*/
110110
@Parameter(property = "transitive", defaultValue = "true")
111111
private boolean transitive = true;
@@ -241,7 +241,7 @@ protected boolean isSkip() {
241241
}
242242

243243
/**
244-
* The groupId of the artifact to download. Ignored if {@link #artifact} is used.
244+
* The groupId of the artifact to resolve. Ignored if {@link #artifact} is used.
245245
*
246246
* @param groupId The groupId.
247247
*/
@@ -251,7 +251,7 @@ public void setGroupId(String groupId) {
251251
}
252252

253253
/**
254-
* The artifactId of the artifact to download. Ignored if {@link #artifact} is used.
254+
* The artifactId of the artifact to resolve. Ignored if {@link #artifact} is used.
255255
*
256256
* @param artifactId The artifactId.
257257
*/
@@ -261,7 +261,7 @@ public void setArtifactId(String artifactId) {
261261
}
262262

263263
/**
264-
* The version of the artifact to download. Ignored if {@link #artifact} is used.
264+
* The version of the artifact to resolve. Ignored if {@link #artifact} is used.
265265
*
266266
* @param version The version.
267267
*/
@@ -271,7 +271,7 @@ public void setVersion(String version) {
271271
}
272272

273273
/**
274-
* The classifier of the artifact to download. Ignored if {@link #artifact} is used.
274+
* The classifier of the artifact to resolve. Ignored if {@link #artifact} is used.
275275
*
276276
* @param classifier The classifier to be used.
277277
*
@@ -283,7 +283,7 @@ public void setClassifier(String classifier) {
283283
}
284284

285285
/**
286-
* The packaging of the artifact to download. Ignored if {@link #artifact} is used.
286+
* The packaging of the artifact to resolve. Ignored if {@link #artifact} is used.
287287
*
288288
* @param type packaging.
289289
*/

src/site/apt/usage.apt.vm

+36-36
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Usage
9090

9191
If you intend to configure this goal for execution on the command line using:
9292

93-
+---+
93+
---
9494
mvn dependency:copy
95-
+---+
95+
---
9696

9797
you must not put the configuration inside the <executions> tag. Your configuration should look like this:
9898

@@ -258,9 +258,9 @@ mvn dependency:copy
258258

259259
If you intend to configure this goal for execution on the command line using:
260260

261-
+---+
261+
---
262262
mvn dependency:unpack
263-
+---+
263+
---
264264

265265
you must not put the configuration inside the <executions> tag. Your configuration should look like this:
266266

@@ -457,16 +457,16 @@ mvn dependency:unpack
457457

458458
In its simplest form, the goal can be called like this:
459459

460-
+---+
460+
---
461461
mvn dependency:purge-local-repository
462-
+---+
462+
---
463463

464464
To add the restriction that the <<<org.apache.maven:maven-plugin-api>>>
465465
artifact not be deleted, we can modify the command to this:
466466

467-
+---+
467+
---
468468
mvn dependency:purge-local-repository -Dexclude=org.apache.maven:maven-plugin-api
469-
+---+
469+
---
470470

471471
<<Note:>> The <<<exclude>>> parameter is a comma-delimited list of
472472
groupId:artifactId pairs. It has a corresponding List-based parameter -
@@ -497,9 +497,9 @@ mvn dependency:purge-local-repository -Dexclude=org.apache.maven:maven-plugin-ap
497497
(in order to verify proper artifact resolution, for example), simply use this
498498
command:
499499

500-
+---+
500+
---
501501
mvn dependency:purge-local-repository -DresolutionFuzziness=artifactId
502-
+---+
502+
---
503503

504504
Finally, it's possible to bind this goal to the build lifecycle. One reason for this
505505
might be to clean out all dependencies when the build is initialized, to verify
@@ -513,9 +513,9 @@ mvn dependency:purge-local-repository -DresolutionFuzziness=artifactId
513513

514514
This goal can be executed from the command line:
515515

516-
+---+
516+
---
517517
mvn dependency:analyze
518-
+---+
518+
---
519519

520520
Sample output:
521521

@@ -540,9 +540,9 @@ mvn dependency:analyze
540540

541541
This goal can be executed from the command line:
542542

543-
+---+
543+
---
544544
mvn dependency:analyze-dep-mgt
545-
+---+
545+
---
546546

547547
Sample output:
548548

@@ -593,15 +593,15 @@ mvn dependency:analyze-dep-mgt
593593

594594
This goal can be executed from the command line:
595595

596-
+-----+
596+
---
597597
mvn dependency:tree
598-
+-----+
598+
---
599599

600600
Optionally, the <<<output>>> parameter can be specified to divert the output to a file:
601601

602-
+-----+
602+
---
603603
mvn dependency:tree -DoutputFile=/path/to/file
604-
+-----+
604+
---
605605

606606
Also, the <<<outputType>>> parameter can be used to generate different formats of output. The
607607
following formats are currently supported:
@@ -616,9 +616,9 @@ mvn dependency:tree -DoutputFile=/path/to/file
616616

617617
[]
618618

619-
+-----+
619+
---
620620
mvn dependency:tree -DoutputFile=/path/to/file.graphml -DoutputType=graphml
621-
+-----+
621+
---
622622

623623

624624
* <<<dependency:build-classpath>>>
@@ -627,27 +627,27 @@ mvn dependency:tree -DoutputFile=/path/to/file.graphml -DoutputType=graphml
627627

628628
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:
629629

630-
+---+
630+
---
631631
/home/foo/.m2/repository/org/java/utils/util/util-1.0.jar:/home/foo/.m2/ ....
632-
+---+
632+
---
633633

634634
The resulting file could then be used like this:
635635

636-
+---+
636+
---
637637
java -cp `cat resultFile` MyClass
638-
+---+
638+
---
639639

640640
In its simplest form, to output the classpath to the log, the goal can be called like this:
641641

642-
+---+
642+
---
643643
mvn dependency:build-classpath
644-
+---+
644+
---
645645

646646
or to write the classpath to cp.txt:
647647

648-
+---+
648+
---
649649
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
650-
+---+
650+
---
651651

652652
The goal can also be bound to a lifecycle phase with the following configuration:
653653

@@ -688,13 +688,13 @@ mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
688688

689689
* <<<dependency:get>>>
690690

691-
This goal fetches an artifact and (optionally) its dependencies from remote repositories using its Maven coordinates.
691+
This goal resolves an artifact and (optionally) its dependencies from remote repositories using its Maven coordinates.
692+
The Maven Central repository are always consider during resolving.
692693

693-
+-----+
694-
mvn dependency:get -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.2.1 -Dpackaging=jar -Dclassifier=sources -DremoteRepositories=central::default::https://repo.maven.apache.org/maven2,myrepo::::http://myrepo.com/maven2
695-
mvn dependency:get -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.2.1 -Dpackaging=jar -Dclassifier=sources -DremoteRepositories=https://repo.maven.apache.org/maven2
696-
mvn dependency:get -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources -DremoteRepositories=https://repo.maven.apache.org/maven2 -Ddest=/tmp/myfile.jar
697-
+-----+
694+
---
695+
mvn dependency:get -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.2.1 -Dpackaging=jar -Dclassifier=sources
696+
mvn dependency:get -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.2.1 -Dpackaging=jar -Dclassifier=sources -DremoteRepositories=https://myrepo.com/maven2
697+
---
698698

699699

700700
* <<<dependency:analyze-exclusions>>>
@@ -704,9 +704,9 @@ mvn dependency:get -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources -Dre
704704
Later a:b:2.0 has removed the unwanted dependency and you upgrade. This goal will inform you that the exclusion is no
705705
longer required.
706706

707-
+---+
707+
---
708708
mvn dependency:analyze-exclusions
709-
+---+
709+
---
710710

711711
Sample output:
712712

0 commit comments

Comments
 (0)