0

I have a multi-module Maven project which has a reactor project with an array of pre-configured plugins and dependencies. Now I want to add an other module to the reactor which uses Spring Boot and now I am facing a problem which I don't know the solution for yet:

Spring Boot requires me to use its own parent:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

but I want to use the configuration supplied by my reactor. How can I work around this?

Making my reactor have the spring-boot-starter-parent as parent is not an option because I'm working on a library and it is not depending on Spring Boot (only this module which implements REST functionality).

Currently my module has spring-boot-starter-parent as its parent and it is included in the reactor so it builds but I lose all my configured code-quality checks for example.

Adam Arold
  • 29,285
  • 22
  • 112
  • 207

2 Answers2

2

You can include spring-boot dependency BOM (bill of materials) in dependency management section giving import scope as described in spring-boot docs

link to another similar stackoverflow question

Community
  • 1
  • 1
Laksitha Ranasingha
  • 4,321
  • 1
  • 28
  • 33
2

Spring Boot doesn't require you to use their parent pom, it's just a little easier for starting. There is an easy way to avoid using the parent pom by

  • adding a scope:import dependency (spring-boot-dependencies) in your dependency management which sets versions for all dependencies used in spring (such that you don't need to set versions manually)
  • adding a maven plugin (spring-boot-maven-plugin) that creates the executable jar

For more details, have a look at the great docs here: http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-maven-without-a-parent

Andreas Jägle
  • 11,632
  • 3
  • 31
  • 31