@@ -56,6 +56,7 @@ public class DefaultJarLauncher implements JarArtifactLauncher {
5656 private Process quarkusProcess ;
5757
5858 private boolean isSsl ;
59+ private Path logFile ;
5960
6061 @ Override
6162 public void init (JarArtifactLauncher .JarInitContext initContext ) {
@@ -74,9 +75,10 @@ public void start() throws IOException {
7475 Function <IntegrationTestStartedNotifier .Context , IntegrationTestStartedNotifier .Result > startedFunction = createStartedFunction ();
7576 LogRuntimeConfig logRuntimeConfig = ConfigProvider .getConfig ().unwrap (SmallRyeConfig .class )
7677 .getConfigMapping (LogRuntimeConfig .class );
78+ logFile = logRuntimeConfig .file ().path ().toPath ();
7779 if (startedFunction != null ) {
7880 IntegrationTestStartedNotifier .Result result = waitForStartedFunction (startedFunction , quarkusProcess ,
79- waitTimeSeconds , logRuntimeConfig . file (). path (). toPath () );
81+ waitTimeSeconds , logFile );
8082 isSsl = result .isSsl ();
8183 } else {
8284 ListeningAddress result = waitForCapturedListeningData (quarkusProcess , logRuntimeConfig .file ().path ().toPath (),
@@ -107,6 +109,7 @@ public LaunchResult runToCompletion(String[] args) {
107109 public void start (String [] programArgs , boolean handleIo ) throws IOException {
108110 SmallRyeConfig config = ConfigProvider .getConfig ().unwrap (SmallRyeConfig .class );
109111 LogRuntimeConfig logRuntimeConfig = config .getConfigMapping (LogRuntimeConfig .class );
112+ logFile = logRuntimeConfig .file ().path ().toPath ();
110113 System .setProperty ("test.url" , TestHTTPResourceManager .getUri ());
111114
112115 List <String > args = new ArrayList <>();
@@ -120,12 +123,12 @@ public void start(String[] programArgs, boolean handleIo) throws IOException {
120123 if (HTTP_PRESENT ) {
121124 args .add ("-Dquarkus.http.port=" + httpPort );
122125 args .add ("-Dquarkus.http.ssl-port=" + httpsPort );
123- // this won't be correct when using the random port but it's really only used by us for the rest client tests
126+ // this won't be correct when using the random port but it's really only used by us for the rest client
127+ // tests
124128 // in the main module, since those tests hit the application itself
125129 args .add ("-Dtest.url=" + TestHTTPResourceManager .getUri ());
126130 }
127- File logPath = logRuntimeConfig .file ().path ();
128- args .add ("-Dquarkus.log.file.path=" + logPath .getAbsolutePath ());
131+ args .add ("-Dquarkus.log.file.path=" + logFile .toAbsolutePath ());
129132 args .add ("-Dquarkus.log.file.enabled=true" );
130133 args .add ("-Dquarkus.log.category.\" io.quarkus\" .level=INFO" );
131134 if (testProfile != null ) {
@@ -141,12 +144,12 @@ public void start(String[] programArgs, boolean handleIo) throws IOException {
141144 System .out .println ("Executing \" " + String .join (" " , args ) + "\" " );
142145
143146 try {
144- Files .deleteIfExists (logPath . toPath () );
145- if (logPath .getParent () != null ) {
146- Files .createDirectories (logPath . toPath () .getParent ());
147+ Files .deleteIfExists (logFile );
148+ if (logFile .getParent () != null ) {
149+ Files .createDirectories (logFile .getParent ());
147150 }
148151 } catch (FileSystemException e ) {
149- log .warnf ("Log file %s deletion failed, could happen on Windows, we can carry on." , logPath );
152+ log .warnf ("Log file %s deletion failed, could happen on Windows, we can carry on." , logFile );
150153 }
151154
152155 if (handleIo ) {
@@ -189,6 +192,8 @@ public void includeAsSysProps(Map<String, String> systemProps) {
189192
190193 @ Override
191194 public void close () {
195+ LauncherUtil .toStdOut (logFile );
192196 LauncherUtil .destroyProcess (quarkusProcess );
193197 }
198+
194199}
0 commit comments