添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

'dependencies.dependency.version' for xxx is missing #104

@tomaskir

Description

Hi there.

I am testing out tiles because I need to bring in Spring Boot (which is normally done through a parent pom) into a project that already has a different parent pom.

I can't touch Spring poms to make our parent into their parent.
I can't make the Spring Boot parent into a parent of our parent (that would bring Spring Boot into all our projects).
So I am hoping to achieve this with tiles .

I have successfully wrote and mvn install ed all the tiles I need, and I can inject them into the project's pom .

However, when trying to mvn compile , or even mvn effective-pom , it seems the tiles are not properly merged into the pom.

[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project xxx:2.0.0-SNAPSHOT (/home/xxx/pom.xml) has 8 errors
[ERROR]     'dependencies.dependency.version' for javax.servlet:javax.servlet-api:jar is missing. @ line 131, column 21
[ERROR]     'dependencies.dependency.version' for org.springframework.security:spring-security-core:jar is missing. @ line 138, column 21
[ERROR]     'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-data-jpa:jar is missing. @ line 144, column 21

All of these are declared as <dependency> in the project's pom, without specifying a version. The version is supposed to come from Spring Boot's <dependencyManagement> section, which is normally brought in from their parent.

I have moved the <dependencyManagement> into a tile, and this tile is properly brought in in the <tiles> section. (I know this is listed as a smell in the tiles documentation, but this is how Spring Boot does things - I don't have much of a choice)

Few questions:

  • any obvious reason why I am not getting the <dependencyManagement> into my pom?
  • I assume tiles runs before the first Maven validate lifecycle phase - is this correct?
  • is there any way to see the pom after it has been "processed" by tiles to inspect how it looks before it gets passed to the Maven validate lifecycle phase?
  • There doesn't seem to be much documentation how tiles actually integrates into Maven (when in the lifecycle tiles does it's thing, how to inspect the output pom that tiles generates before it goes to Maven etc.)

    Any inside is appreciated, thanks!