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

Behavior when multiple tiles define the same profile differently is unclear #73

Open
udalrich opened this issue Oct 31, 2017 · 1 comment

Comments

@udalrich
Copy link

The documentation does not say what happens when a profile is defined with the same id but different implementations in different tiles.

I have the following profile in my inheritance-based pom:

    <profile>
        <id>attachDebugger</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <!-- Wait for debugger to attach to port 5005 -->
                        <debugForkedProcess>true</debugForkedProcess>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <configuration>
                        <!-- Wait for debugger to attach to port 5005 -->
                        <debugForkedProcess>true</debugForkedProcess>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

Logically, when converting to tiles, I would expect to define a tile to run surefire and a separate tile to run failsafe. In each tile, I would like to define a profile with id attachDebugger that defines the appropriate plugin with the given configuration. It is unclear if I do this if I will get build errors, the profiles will be merged or if one profile will win and the other will be (silently?) ignored.

@rvowles
Copy link
Member

rvowles commented Oct 31, 2017

We use the code in Maven itself to merge poms together, it is the same code used when merging parents. That said, I have spoken with someone else who had some difficulty trying to figure out what was going on with his profiles - but that was more about them existing at all rather than them merging.

If you put stuff in a tile and then do a mvn help:effective-pom - it should tell you what you get.

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