90
90
91
91
If you intend to configure this goal for execution on the command line using:
92
92
93
- + ---+
93
+ ---
94
94
mvn dependency:copy
95
- + ---+
95
+ ---
96
96
97
97
you must not put the configuration inside the <executions> tag. Your configuration should look like this:
98
98
@@ -258,9 +258,9 @@ mvn dependency:copy
258
258
259
259
If you intend to configure this goal for execution on the command line using:
260
260
261
- + ---+
261
+ ---
262
262
mvn dependency:unpack
263
- + ---+
263
+ ---
264
264
265
265
you must not put the configuration inside the <executions> tag. Your configuration should look like this:
266
266
@@ -457,16 +457,16 @@ mvn dependency:unpack
457
457
458
458
In its simplest form, the goal can be called like this:
459
459
460
- + ---+
460
+ ---
461
461
mvn dependency:purge-local-repository
462
- + ---+
462
+ ---
463
463
464
464
To add the restriction that the <<<org.apache.maven:maven-plugin-api>>>
465
465
artifact not be deleted, we can modify the command to this:
466
466
467
- + ---+
467
+ ---
468
468
mvn dependency:purge-local-repository -Dexclude=org.apache.maven:maven-plugin-api
469
- + ---+
469
+ ---
470
470
471
471
<<Note:>> The <<<exclude>>> parameter is a comma-delimited list of
472
472
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
497
497
(in order to verify proper artifact resolution, for example), simply use this
498
498
command:
499
499
500
- + ---+
500
+ ---
501
501
mvn dependency:purge-local-repository -DresolutionFuzziness=artifactId
502
- + ---+
502
+ ---
503
503
504
504
Finally, it's possible to bind this goal to the build lifecycle. One reason for this
505
505
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
513
513
514
514
This goal can be executed from the command line:
515
515
516
- + ---+
516
+ ---
517
517
mvn dependency:analyze
518
- + ---+
518
+ ---
519
519
520
520
Sample output:
521
521
@@ -540,9 +540,9 @@ mvn dependency:analyze
540
540
541
541
This goal can be executed from the command line:
542
542
543
- + ---+
543
+ ---
544
544
mvn dependency:analyze-dep-mgt
545
- + ---+
545
+ ---
546
546
547
547
Sample output:
548
548
@@ -593,15 +593,15 @@ mvn dependency:analyze-dep-mgt
593
593
594
594
This goal can be executed from the command line:
595
595
596
- + -----+
596
+ ---
597
597
mvn dependency:tree
598
- + -----+
598
+ ---
599
599
600
600
Optionally, the <<<output>>> parameter can be specified to divert the output to a file:
601
601
602
- + -----+
602
+ ---
603
603
mvn dependency:tree -DoutputFile=/path/to/file
604
- + -----+
604
+ ---
605
605
606
606
Also, the <<<outputType>>> parameter can be used to generate different formats of output. The
607
607
following formats are currently supported:
@@ -616,9 +616,9 @@ mvn dependency:tree -DoutputFile=/path/to/file
616
616
617
617
[]
618
618
619
- + -----+
619
+ ---
620
620
mvn dependency:tree -DoutputFile=/path/to/file.graphml -DoutputType=graphml
621
- + -----+
621
+ ---
622
622
623
623
624
624
* <<<dependency:build-classpath>>>
@@ -627,27 +627,27 @@ mvn dependency:tree -DoutputFile=/path/to/file.graphml -DoutputType=graphml
627
627
628
628
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:
629
629
630
- + ---+
630
+ ---
631
631
/home/foo/.m2/repository/org/java/utils/util/util-1.0.jar:/home/foo/.m2/ ....
632
- + ---+
632
+ ---
633
633
634
634
The resulting file could then be used like this:
635
635
636
- + ---+
636
+ ---
637
637
java -cp `cat resultFile` MyClass
638
- + ---+
638
+ ---
639
639
640
640
In its simplest form, to output the classpath to the log, the goal can be called like this:
641
641
642
- + ---+
642
+ ---
643
643
mvn dependency:build-classpath
644
- + ---+
644
+ ---
645
645
646
646
or to write the classpath to cp.txt:
647
647
648
- + ---+
648
+ ---
649
649
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
650
- + ---+
650
+ ---
651
651
652
652
The goal can also be bound to a lifecycle phase with the following configuration:
653
653
@@ -688,13 +688,13 @@ mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
688
688
689
689
* <<<dependency:get>>>
690
690
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.
692
693
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
+ ---
698
698
699
699
700
700
* <<<dependency:analyze-exclusions>>>
@@ -704,9 +704,9 @@ mvn dependency:get -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources -Dre
704
704
Later a:b:2.0 has removed the unwanted dependency and you upgrade. This goal will inform you that the exclusion is no
705
705
longer required.
706
706
707
- + ---+
707
+ ---
708
708
mvn dependency:analyze-exclusions
709
- + ---+
709
+ ---
710
710
711
711
Sample output:
712
712
0 commit comments