@@ -156,7 +156,11 @@ private static void buildApp(Path projectDir) throws IOException {
156
156
} catch (Exception e ) {
157
157
log .error ("Failed to destroy the process" , e );
158
158
}
159
- fail ("The process has exceeded the time out limit of " + getBuildAppTimeout () + " seconds" );
159
+ final String timeoutMessage = "The process has exceeded the timeout limit of " + getBuildAppTimeout ()
160
+ + " seconds" ;
161
+ log .error (timeoutMessage );
162
+ logCliProcessOutput (cliLog , cliErrors );
163
+ fail (timeoutMessage );
160
164
}
161
165
} catch (InterruptedException e ) {
162
166
log .error ("Interrupted waiting for the process to complete" , e );
@@ -173,6 +177,25 @@ private static void buildApp(Path projectDir) throws IOException {
173
177
}
174
178
}
175
179
180
+ private static void logCliProcessOutput (Path cliLog , Path cliErrors ) throws IOException {
181
+ if (Files .exists (cliLog )) {
182
+ String output = Files .readString (cliLog );
183
+ if (!output .isBlank ()) {
184
+ log .info ("BEGIN the CLI process output:" );
185
+ log .info (output );
186
+ log .info ("END the CLI process output" );
187
+ }
188
+ }
189
+ if (Files .exists (cliLog )) {
190
+ String output = Files .readString (cliErrors );
191
+ if (!output .isBlank ()) {
192
+ log .info ("BEGIN the CLI process error output:" );
193
+ log .info (output );
194
+ log .info ("END the CLI process error output" );
195
+ }
196
+ }
197
+ }
198
+
176
199
private static String getMvnPath () {
177
200
var mavenHome = System .getProperty ("maven.home" );
178
201
if (mavenHome == null ) {
@@ -213,7 +236,11 @@ private static Path generateSampleAppWithMaven() throws IOException {
213
236
} catch (Exception e ) {
214
237
log .error ("Failed to destroy the process" , e );
215
238
}
216
- fail ("The process has exceeded the time out limit of " + getGenerateAppTimeout () + " seconds" );
239
+ final String timeoutMessage = "The process has exceeded the time out limit of " + getGenerateAppTimeout ()
240
+ + " seconds" ;
241
+ log .error (timeoutMessage );
242
+ logCliProcessOutput (cliLog , cliErrors );
243
+ fail (timeoutMessage );
217
244
}
218
245
} catch (InterruptedException e ) {
219
246
log .error ("Interrupted waiting for the process to complete" , e );
0 commit comments