You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have a pom who's parent pom's groupId is com.a, and you're using a tile with a different groupId, e.g. com.b:
<tile>com.b:my-tile:1.0</tile>
Maven tiles is smart enough to make sure the project's groupId is set correctly, so ${project.groupId} will be resolved to com.a. However it doesn't do this for the parent project's groupId, so ${project.parent.groupId} resolves to the tile's groupId instead of the parent pom's groupId.
Here's an example to illustrate this:
<parent>
<!-- This parent pom groupId is what I'd expect to be returned from ${project.parent.groupId} -->
<groupId>com.a</groupId>
<artifactId>my-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>my-child</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.15</version>
<extensions>true</extensions>
<configuration>
<tiles>
<!-- note that this groupId is different from the pom's parent groupId -->
<tile>com.b:my-tile:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<!-- This is the bug; maven resolves this variable to the *tile's* groupId, i.e. "com.b", and not the parent pom's groupId of "com.a" -->
<groupId>${project.parent.groupId}</groupId>
<artifactId>another-child</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
The text was updated successfully, but these errors were encountered:
Tiles is (currently) only filling in the groupId/version in the current projects model to that of a declared parent *when absent*, which is why `project.groupId` actually has a value.
The way tiles works is by injecting parents, so `project.parent.groupId` as a property reflects the shape of the model.
We _could_ tho set some additional properties for things like `tiledProject.parent.groupId`, `tiledProject.parent.artifact`, and `tiledProject.parent.version`.
Maybe...
We could tho set some additional properties for things like tiledProject.parent.groupId, tiledProject.parent.artifact, and tiledProject.parent.version.
Do you see any downside (regression risk, added complexity, etc.) to doing this, or is it just having the time to make the code change? (which is mostly adding/updating tests, I'm guessing?)
Let's say you have a pom who's parent pom's groupId is
com.a
, and you're using a tile with a different groupId, e.g.com.b
:Maven tiles is smart enough to make sure the project's
groupId
is set correctly, so${project.groupId}
will be resolved tocom.a
. However it doesn't do this for the parent project's groupId, so${project.parent.groupId}
resolves to the tile's groupId instead of the parent pom's groupId.Here's an example to illustrate this:
The text was updated successfully, but these errors were encountered: