@@ -61,13 +61,15 @@ public void setup() {
6161
6262 @ Test
6363 public void testUseSingleJar () throws Exception {
64+ printDeps ();
6465 buildSingleJar ();
6566 buildMainClass ();
6667 runTestApplication ();
6768 }
6869
6970 @ Test
7071 public void testUseShadedJar () throws Exception {
72+ printDeps ();
7173 buildShadedJar ();
7274 buildMainClass ();
7375 runTestApplication ();
@@ -91,6 +93,12 @@ private void runTestApplication() throws Exception {
9193 execute (builder );
9294 }
9395
96+ private void printDeps () throws Exception {
97+ ProcessBuilder builder = new ProcessBuilder ();
98+ builder .command ("mvn" , "dependency:tree" );
99+ execute (builder , true );
100+ }
101+
94102 private void buildSingleJar () throws Exception {
95103 ProcessBuilder builder = new ProcessBuilder ();
96104 builder .command ("mvn" , "clean" , "package" , "-DskipTests" , "-Dalt.build.dir=./target/single" );
@@ -116,11 +124,23 @@ private void buildMainClass() throws Exception {
116124 }
117125
118126 private void execute (ProcessBuilder builder ) throws Exception {
127+ execute (builder , false );
128+ }
129+
130+ private void execute (ProcessBuilder builder , boolean showOutput ) throws Exception {
119131 Process process = builder .start ();
120- String errors ;
132+ String errors , output = "" ;
121133 try (InputStreamReader reader = new InputStreamReader (process .getErrorStream ())) {
122134 errors = CharStreams .toString (reader );
123135 }
136+ if (showOutput ) {
137+ try (InputStreamReader reader = new InputStreamReader (process .getInputStream ())) {
138+ output = CharStreams .toString (reader );
139+ }
140+ }
124141 assertEquals (errors , 0 , process .waitFor ());
142+ if (showOutput ) {
143+ System .out .print (output );
144+ }
125145 }
126146}
0 commit comments