spring-petclinic / spring-petclinic-microservices

Distributed version of Spring Petclinic built with Spring Cloud
Apache License 2.0
1.67k stars 2.17k forks source link

Support for Arm64 and Amd64 to start services locally without using docker #228

Closed odidev closed 1 year ago

odidev commented 1 year ago

@arey, I am trying to start the services locally i.e. without using docker, it shows below error in both arm64 and amd64 architectures:

ubuntu@ip-172-31-23-20:~/spring-petclinic-microservices$ ./mvnw spring-boot:run 
[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Build Order: 
[INFO] 
[INFO] spring-petclinic-microservices                                     [pom] 
[INFO] spring-petclinic-admin-server                                      [jar] 
[INFO] spring-petclinic-customers-service                                 [jar] 
[INFO] spring-petclinic-vets-service                                      [jar] 
[INFO] spring-petclinic-visits-service                                    [jar] 
[INFO] spring-petclinic-config-server                                     [jar] 
[INFO] spring-petclinic-discovery-server                                  [jar] 
[INFO] spring-petclinic-api-gateway                                       [jar] 
[INFO] 
[INFO] -----< org.springframework.samples:spring-petclinic-microservices >----- \
[INFO] Building spring-petclinic-microservices 3.0.2                      [1/8] 
[INFO] --------------------------------[ pom ]--------------------------------- 
[INFO] 
[INFO] >>> spring-boot-maven-plugin:3.0.2:run (default-cli) > test-compile @ spring-petclinic-microservices >>> 
[INFO] 
[INFO] <<< spring-boot-maven-plugin:3.0.2:run (default-cli) < test-compile @ spring-petclinic-microservices <<< 
[INFO] 
[INFO] 
[INFO] --- spring-boot-maven-plugin:3.0.2:run (default-cli) @ spring-petclinic-microservices --- 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary: 
[INFO] 
[INFO] spring-petclinic-microservices 3.0.2 ............... FAILURE [  0.843 s] 
[INFO] spring-petclinic-admin-server ...................... SKIPPED 
[INFO] spring-petclinic-customers-service ................. SKIPPED 
[INFO] spring-petclinic-vets-service ...................... SKIPPED 
[INFO] spring-petclinic-visits-service .................... SKIPPED 
[INFO] spring-petclinic-config-server ..................... SKIPPED 
[INFO] spring-petclinic-discovery-server .................. SKIPPED 
[INFO] spring-petclinic-api-gateway 3.0.2 ................. SKIPPED 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.766 s 
[INFO] Finished at: 2023-05-15T04:26:49Z 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project spring-petclinic-microservices: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

Could you please share your feedback regarding the same, it would be really helpful.

Thanks in advance!

arey commented 1 year ago

Hi @odidev You executed the ./mvnw spring-boot:run command line at the root folder. You have to start individual microservices from their own sub-directories:

cd spring-petclinic-config-server
../mvnw spring-boot:run
odidev commented 1 year ago

@arey, Thanks for the suggestion. I am able to build the microservices locally.