@@ -979,6 +979,60 @@ func TestPom_Parse(t *testing.T) {
979
979
},
980
980
},
981
981
},
982
+ // ➜ mvn dependency:tree
983
+ // ...
984
+ // [INFO]
985
+ // [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ child ---
986
+ // [INFO] com.example:child:jar:3.0.0
987
+ // [INFO] \- org.example:example-exclusions:jar:3.0.0:compile
988
+ // [INFO] \- org.example:example-nested:jar:3.3.3:compile
989
+ // [INFO] ------------------------------------------------------------------------
990
+ {
991
+ name : "exclusions in child and parent dependency management" ,
992
+ inputFile : filepath .Join ("testdata" , "exclusions-parent-dependency-management" , "child" , "pom.xml" ),
993
+ local : true ,
994
+ want : []ftypes.Package {
995
+ {
996
+ ID : "com.example:child:3.0.0" ,
997
+ Name : "com.example:child" ,
998
+ Version : "3.0.0" ,
999
+ Licenses : []string {"Apache 2.0" },
1000
+ Relationship : ftypes .RelationshipRoot ,
1001
+ },
1002
+ {
1003
+ ID : "org.example:example-exclusions:3.0.0" ,
1004
+ Name : "org.example:example-exclusions" ,
1005
+ Version : "3.0.0" ,
1006
+ Relationship : ftypes .RelationshipDirect ,
1007
+ Locations : ftypes.Locations {
1008
+ {
1009
+ StartLine : 26 ,
1010
+ EndLine : 35 ,
1011
+ },
1012
+ },
1013
+ },
1014
+ {
1015
+ ID : "org.example:example-nested:3.3.3" ,
1016
+ Name : "org.example:example-nested" ,
1017
+ Version : "3.3.3" ,
1018
+ Relationship : ftypes .RelationshipIndirect ,
1019
+ },
1020
+ },
1021
+ wantDeps : []ftypes.Dependency {
1022
+ {
1023
+ ID : "com.example:child:3.0.0" ,
1024
+ DependsOn : []string {
1025
+ "org.example:example-exclusions:3.0.0" ,
1026
+ },
1027
+ },
1028
+ {
1029
+ ID : "org.example:example-exclusions:3.0.0" ,
1030
+ DependsOn : []string {
1031
+ "org.example:example-nested:3.3.3" ,
1032
+ },
1033
+ },
1034
+ },
1035
+ },
982
1036
{
983
1037
name : "exclusions with wildcards" ,
984
1038
inputFile : filepath .Join ("testdata" , "wildcard-exclusions" , "pom.xml" ),
0 commit comments