repaint-io / maven-tiles

Injecting maven configurations by composition rather than inheritance
154 stars 32 forks source link

Not getting any traction at all #22

Closed benson-basis closed 9 years ago

benson-basis commented 9 years ago

So, I created a tile. tile.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <properties>
        <bt-rli-je-version>7.12.100</bt-rli-je-version>
        <bt-rbl-je-version>7.12.100</bt-rbl-je-version>
        <bt-rex-je-version>7.11.1.102</bt-rex-je-version>
        <bt-res-version>0.9.2.100</bt-res-version>
        <bt-tcat-version>0.2.2</bt-tcat-version>
        <bt-tcat-model-version>0.2.0</bt-tcat-model-version>
    </properties>
</project>

I've installed this artifact.

In the top pom of a multi-module project, I have:

<build>
 <plugins>
            <plugin>
                <groupId>io.repaint.maven</groupId>
                <artifactId>tiles-maven-plugin</artifactId>
                <version>1.8</version>
                <extensions>true</extensions>
                <configuration>
                    <tiles>
                        <tile>com.basistech.tiles:platform-versions-tile:0.0.1-SNAPSHOT</tile>
                    </tiles>
                </configuration>
            </plugin>
</plugins>
...
</build>

The properties in the tile.xml are not seen by Maven when I try to use them with Maven 3.0.4. I assume that I'm missing something trivial here, but, what? mvn -X is not showing any signs of life. I am trying to use these properties as dependency versions.

I note that the examples I can find are all using older versions than 1.8 of the plugin; is there an example out there today I can clone and play with?

rvowles commented 9 years ago

We do not support multi module builds. Please use a composite.

talios commented 9 years ago

Do properties copy across in non-multimodule builds?

We may not promote multi-module builds, but I think that's a separate thing, we should support migration paths at least.

talios commented 9 years ago

If you include:

<inherited>true</inherited>

in your <plugin> configuration for the tiles plugin, then the plugin will be inherited to child POMs and applied. As a maven lifecycle contributor - without this, the tiles plugin is only run against the parent POM and not against the children, in practice this shouldn't really be an issue as during a mvn clean install the tiled parent will be installed and subsequently used by the children. However, when doing a help:effective-pom with such filtering commands as -pl - Maven looks at the source file of the parent pom and not the installed POM without invoking the lifecycle contributor and gives you a distorted view of execution.

Technically, Maven is "correct" since at it's core, the tiles plugin is a clever hack which has shortcomings when it comes to multi-module builds using <parent> references within the same build session for this very reason - the parent pom.xml on disk is not the same as one that gets deployed/processed.

If you need to continue using your multi-module build at present, I suggest redeclaring the tiles plugin in each child pom rather than parent and consider the move to breaking up your repositories and moving away from the parent structure.