when build an spring project with this command:

mvn spring-boot:run

 

there will may show an error message like this:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.2.5.RELEASE:run (default-cli) on project gs-rest-service: Unable to find a suitable main class, please add a 'mainClass’ property

 

ok,i was bothering by this case...so,,,google..google..and find this web page:

http://docs.spring.io/autorepo/docs/spring-boot/1.2.4.RELEASE/maven-plugin/usage.html

 

And ,this is the Solution(the bold part)

 

<plugin>

 

  <groupId>org.springframework.boot</groupId>

 

  <artifactId>spring-boot-maven-plugin</artifactId>

 

  <configuration>

 

    <mainClass>class_name</mainClass>

 

  </configuration>

 

</plugin>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-04-20
  • 2022-12-23
  • 2021-08-19
  • 2022-03-09
猜你喜欢
  • 2021-09-05
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-05-15
  • 2021-04-30
相关资源
相似解决方案