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
Tiles plugin fails to recognize the property template in POM packaging tag. So, if we specify the packaging tag this way <packaging>${packaging}</packaging>, plugin doesn't run tiles configuration.
Running mvn clean install triggers it.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT, so we can see such logs in console:
[INFO] --- tiles-maven-plugin: Injecting 1 tiles as intermediary parent artifacts for example.micronaut:micronauttiles...
[INFO] Mixed 'example.micronaut:micronauttiles:0.1' with tile 'it.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT' as its new parent.
[INFO] Mixed 'it.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT' with original parent 'io.micronaut:micronaut-parent:3.8.1' as its new top level parent.
Actual behavior
Define the same POM as is in Expected behavior section.
Run mvn clean install. There will be no expected logs in console. That means that tile is not applied.
However, if we defined packaging explicitly <packaging>jar</packaging>, tile is applied successfully.
Verify the output. Check that maven-jetty-tile was not injected.
Specify the packaging tag value explicitly. Change the <packaging>${packaging}</packaging> to <packaging>jar</packaging>.
Build project. Run the mvn clean install.
Verify the output. The next rows presented:
[INFO] --- tiles-maven-plugin: Injecting 1 tiles as intermediary parent artifacts for example.micronaut:micronauttiles...
[INFO] Mixed 'example.micronaut:micronauttiles:0.1' with tile 'it.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT' as its new parent.
[INFO] Mixed 'it.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT' with original parent 'io.micronaut:micronaut-parent:3.8.1' as its new top level parent.
The text was updated successfully, but these errors were encountered:
I suspect this is more a maven issue than tiles itself. The tiles extension is triggered from the afterProjectsRead call of AbstractMavenLifecycleParticipant:
Invoked after all MavenProject instances have been created. This callback is intended to allow extensions to manipulate MavenProjects before they are sorted and actual build execution starts.
At this point in time, I suspect the properties have not been resolved (which is known to cause some other limitations/oddities elsewhere) which may be preventing the extension from running.
Is there any particular reason for declaring the packaging type as a property - that seems awfully odd to me.
Absolutely agree with you regarding using properties for packaging :)
However, there is a problem. The organization I'm working in is actively using the Maven Tiles plugin. Also, we use Micronaut. The thing is that Micronaut CLI generates projects with packaging property. So, each time somebody in the organization creates a project they face this issue.
This is not a priority cause we can mitigate it. However, would be nice to fix it.
Environment Details
Problem Description
Tiles plugin fails to recognize the property template in POM packaging tag. So, if we specify the packaging tag this way
<packaging>${packaging}</packaging>
, plugin doesn't run tiles configuration.Expected behavior
mvn clean install
triggersit.session.maven.tiles:maven-jetty-tile:0.8-SNAPSHOT
, so we can see such logs in console:Actual behavior
Expected behavior
section.mvn clean install
. There will be no expected logs in console. That means that tile is not applied.<packaging>jar</packaging>
, tile is applied successfully.Steps to reproduce
Clone the repaint-io/maven-tiles-examples GIT repository.
Install the
maven-tiles-examples
to local maven repository. Runmvn clean install
.NOTE: I was unable a build project with
tiles-maven-plugin
version1.1-SNAPSHOT
, so I've replaced it in each module of the project with2.31
.Download the example Micronaut application from step 3 of the official quick-start guide.
Add the
maven-jetty-tile
to your stub Micronaut app:Build project. Run the
mvn clean install
.Verify the output. Check that
maven-jetty-tile
was not injected.Specify the
packaging
tag value explicitly. Change the<packaging>${packaging}</packaging>
to<packaging>jar</packaging>
.Build project. Run the
mvn clean install
.Verify the output. The next rows presented:
The text was updated successfully, but these errors were encountered: