spring-projects-experimental / spring-boot-migrator

Spring Boot Migrator (SBM) is a tool for automated code migrations to upgrade or migrate to Spring Boot
Apache License 2.0
439 stars 88 forks source link

Spring boot upgrade jar is giving issue in scanning the project #941

Closed parshant-kumar-96 closed 11 months ago

parshant-kumar-96 commented 11 months ago

While running the below command to upgrade a spring boot application using Spring boot upgrade jar getting below error.

Command used : java -jar --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED spring-boot-upgrade.jar SpringBootUpgrad

Error occured is

powered by Spring Boot Migrator


Find us on GitHub: https://via.vmw.com/8AD63p

Please report all errors: https://via.vmw.com/bXlqJC


Scanning SpringBootUpgrade 14:54:37.190 [main] ERROR o.s.boot.SpringApplication - Application run failed java.lang.IllegalStateException: Failed to execute ApplicationRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:752) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) at org.springframework.sbm.SpringBootUpgradeReportApp.main(SpringBootUpgradeReportApp.java:31) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) Caused by: java.lang.IllegalArgumentException: Revision must not be null. This might be due to a problem retrieving the last commit hash from git. at org.springframework.util.Assert.notNull(Assert.java:201) at org.springframework.sbm.engine.git.ProjectSyncVerifier.isProjectInSync(ProjectSyncVerifier.java:65) at org.springframework.sbm.engine.git.ProjectSyncVerifier.verifyProjectIsInSyncWhenGitAvailable(ProjectSyncVerifier.java:55) at org.springframework.sbm.engine.commands.ApplyCommand.execute(ApplyCommand.java:72) at org.springframework.sbm.SpringBootMigratorRunner.run(SpringBootMigratorRunner.java:50) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762) ... 11 common frames omitted Failed to execute ApplicationRunner java.lang.IllegalStateException: Failed to execute ApplicationRunner

fabapp2 commented 11 months ago

Hi @parshant-kumar-96

Caused by: java.lang.IllegalArgumentException: Revision must not be null. This might be due to a problem retrieving the last commit hash from git.

Could it be that something's wrong with the git repo in the scanned project? Could you try passing -Dsbm.gitSupportEnabled=false and see if this works? I'll close the issue. Please reopen if the problem persists.