Skip to content

Use provided (if any) port in URL to report printed on console #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.springframework.sbm;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;
Expand All @@ -33,6 +34,9 @@ public class SpringBootMigratorRunner implements ApplicationRunner {
private final ApplyCommand applyCommand;
private final String REPORT_RECIPE = "sbu30-report";

@Value("${server.port:8080}")
private String port;

@Override
public void run(ApplicationArguments args) {
if (args.getSourceArgs().length == 0) {
Expand All @@ -44,8 +48,6 @@ public void run(ApplicationArguments args) {
ProjectContext context = scanCommand.execute(applicationPath);
contextHolder.setProjectContext(context);
applyCommand.execute(contextHolder.getProjectContext(), REPORT_RECIPE);
System.out.println("finished scan. Please open: http://localhost:8080/spring-boot-upgrade");
System.out.printf("finished scan. Please open: http://localhost:%s/spring-boot-upgrade\n", port);
}


}