Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${project.parent.groupId} resolution doesn't work #103

Open
skingsland opened this issue Jul 3, 2019 · 2 comments
Open

${project.parent.groupId} resolution doesn't work #103

skingsland opened this issue Jul 3, 2019 · 2 comments

Comments

@skingsland
Copy link

skingsland commented Jul 3, 2019

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>
@talios
Copy link
Member

talios commented Jul 4, 2019 via email

@skingsland
Copy link
Author

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?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants