Spring Boot Starter Parent Usage in Maven

综合编程 2018-08-22 阅读原文

I quite often see Spring Boot projects which are using the spring-boot-starter-parent
as the following:

  4.0.0

  
    org.springframework.boot
    spring-boot-starter-parent
    2.0.4.RELEASE
    
  

  
    UTF-8
    UTF-8
    1.8
  
  ...
  
    
      
        org.springframework.boot
        spring-boot-maven-plugin
      
    
  

So far so good. Notices something? I have to mention that you can do it
a little bit shorter like this:

  4.0.0

  
    org.springframework.boot
    spring-boot-starter-parent
    2.0.4.RELEASE
    
  

  ...
  
    
      
        org.springframework.boot
        spring-boot-maven-plugin
      
    
  

The properties defined in the first example are alread defined in the spring-boot-starter-parent
pom file which means you do not need to define
them another time cause you already inherit them via the parent.

责编内容by:soebes 【阅读原文】。感谢您的支持!