repaint-io / maven-tiles Goto Github PK
View Code? Open in Web Editor NEWInjecting maven configurations by composition rather than inheritance
Injecting maven configurations by composition rather than inheritance
I had thought we had the ability to attach a tile to an existing project, but it seems that io.repaint.maven.tiles.AttachTileMojo#execute
includes an assertion that the projects <packaging>
is tile
.
We should probably just remove this assertion as the attach-tile
goal is triggered by the custom lifecycle already - if you include the plugin and configure an execution it should just work.
When creating a checkstyle artifact jar with a tile attached, I had to repeat a lot of the configuration between the pom.xml and the tile.xml. It'd be neat if there were some streamlined way to pass configuration from the pom to the tile.
When using a release tile, particularly, you generally don't want that tile to cascade as then folds itself into the entire build system. You could use a Central release tile but wish to use that tile in a local build which requires a different release mechanism.
....should be supported. "cascade" should only be used when parsing an imported tile.
2.4 through to 2.7 (inclusive) work fine. The only version affected is 2.8.
Mar 17, 2016 1:22:35 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: io.repaint.maven.tiles.TilesMavenLifecycleParticipant
java.lang.NoClassDefFoundError: org/apache/maven/model/building/ModelSource2
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
at java.lang.Class.getDeclaredConstructors(Class.java:2012)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.sonatype.guice.bean.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:112)
at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
at org.apache.maven.DefaultMaven.getLifecycleParticipants(DefaultMaven.java:538)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:270)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.model.building.ModelSource2
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 56 more
---------------------------------------------------
constituent[0]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/aether-api-1.13.1.jar
constituent[1]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/aether-connector-wagon-1.13.1.jar
constituent[2]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/aether-impl-1.13.1.jar
constituent[3]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/aether-spi-1.13.1.jar
constituent[4]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/aether-util-1.13.1.jar
constituent[5]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/commons-cli-1.2.jar
constituent[6]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/commons-io-2.2.jar
constituent[7]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/commons-lang-2.6.jar
constituent[8]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-aether-provider-3.0.5.jar
constituent[9]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-artifact-3.0.5.jar
constituent[10]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-compat-3.0.5.jar
constituent[11]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-core-3.0.5.jar
constituent[12]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-embedder-3.0.5.jar
constituent[13]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-model-3.0.5.jar
constituent[14]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-model-builder-3.0.5.jar
constituent[15]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-plugin-api-3.0.5.jar
constituent[16]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-repository-metadata-3.0.5.jar
constituent[17]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-settings-3.0.5.jar
constituent[18]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/maven-settings-builder-3.0.5.jar
constituent[19]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/plexus-cipher-1.7.jar
constituent[20]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/plexus-component-annotations-1.5.5.jar
constituent[21]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/plexus-interpolation-1.14.jar
constituent[22]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/plexus-sec-dispatcher-1.3.jar
constituent[23]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/plexus-utils-2.0.6.jar
constituent[24]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/sisu-guava-0.9.9.jar
constituent[25]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/sisu-guice-3.1.0-no_aop.jar
constituent[26]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/sisu-inject-bean-2.3.0.jar
constituent[27]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/sisu-inject-plexus-2.3.0.jar
constituent[28]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/wagon-file-2.8.jar
constituent[29]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/wagon-http-2.8-shaded.jar
constituent[30]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/wagon-http-shared-2.8.jar
constituent[31]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.3/plugins/maven/lib/maven3/lib/wagon-provider-api-2.8.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/maven/model/building/ModelSource2
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
at java.lang.Class.getDeclaredConstructors(Class.java:2012)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.sonatype.guice.bean.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:112)
at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
at org.apache.maven.DefaultMaven.getLifecycleParticipants(DefaultMaven.java:538)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:270)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.model.building.ModelSource2
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 56 more
Currently we now prevent you including the tiles plugin your parent pom full stop, but I just hit a scenario (using a release tile) where I wanted the tile there, specifically for the parent/reactor artefact so flagged it as non-inherited.
This still breaks the build tho.
With snapshot version of a tile, it works fine locally when using maven install command.
But, when deployed to a repository manager (ie Artifactory), Maven never find the tile and seems to not look into the specified snapshot repository. Only the release repository is used instead.
Fyi, It works fine with not snapshot version locally and remotely.
When extracting a release tile containing scm
and distributionManagement
sections, I discovered the current tiles-maven-plugin
does not merge across the distributionManagement
section into the final pom.
java.lang.NullPointerException
at org.jetbrains.idea.maven.model.MavenProjectProblem.hashCode(MavenProjectProblem.java:92)
at java.util.HashMap.hash(HashMap.java:338)
at java.util.HashMap.put(HashMap.java:611)
at java.util.HashSet.add(HashSet.java:219)
at org.jetbrains.idea.maven.server.Maven32ServerEmbedderImpl.validate(Maven32ServerEmbedderImpl.java:935)
at org.jetbrains.idea.maven.server.Maven32ServerEmbedderImpl.createExecutionResult(Maven32ServerEmbedderImpl.java:862)
at org.jetbrains.idea.maven.server.Maven32ServerEmbedderImpl.resolveProject(Maven32ServerEmbedderImpl.java:549)
at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
It would appear we've once again broken under 3.0.x ( 3.0.4 and 3.0.5 tested ):
Exception in thread "main" java.lang.IllegalAccessError: class io.repaint.maven.tiles.ThunkedInheritanceAssembler$FixedInheritanceAssembler cannot access its superclass org.apache.maven.model.inheritance.DefaultInheritanceAssembler$InheritanceModelMerger
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.thunkModelBuilder(TilesMavenLifecycleParticipant.groovy:312)
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.orchestrateMerge(TilesMavenLifecycleParticipant.groovy:258)
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.afterProjectsRead(TilesMavenLifecycleParticipant.groovy:237)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
The Eclipse m2e plugin does not recognize lifecycle participants. It is not clear how to get it to do so - most of the configuration options for m2e involve telling it about items that need to be watched for when it is building incrementally.
Tiles does not affect the incremental build, only the full refresh (when the Maven | Update is requested) then there appears to be no documentation on how this could work. It may require a full Eclipse plugin with OSGi - which would be @talios 's territory.
If order to make understanding projects that use tiles a little easier, interpolate the tile's GAV into the execution ID of any tile plugin/execution.
I.e.
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (com.smxemail.tiles:com.smxemail.tiles.enforcements:1.0.2::enforce-versions) @ smx3.agreement ---
IntelliJ 15 seems to trigger with this error occasionally on one of our projects when configured to use the upcoming Maven 3.3.8 release, tho I've seen it on a few earlier releases.
Even tho IntelliJ is configured to use the external Maven release, the stacktrace points to using the internal Maven30Server still...
2015-11-09 10:51:09,594 [ 138592] INFO - #org.jetbrains.idea.maven - org/apache/maven/project/DefaultModelBuildingListener
java.lang.IllegalAccessError: org/apache/maven/project/DefaultModelBuildingListener
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.thunkModelBuilder(TilesMavenLifecycleParticipant.groovy:287)
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.orchestrateMerge(TilesMavenLifecycleParticipant.groovy:268)
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.afterProjectsRead(TilesMavenLifecycleParticipant.groovy:245)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.loadExtensions(Maven30ServerEmbedderImpl.java:737)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.access$300(Maven30ServerEmbedderImpl.java:104)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl$2.run(Maven30ServerEmbedderImpl.java:621)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.executeWithMavenSession(Maven30ServerEmbedderImpl.java:568)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.doResolveProject(Maven30ServerEmbedderImpl.java:586)
at org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.resolveProject(Maven30ServerEmbedderImpl.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2015-11-09 10:51:09,625 [ 138623] INFO - #org.jetbrains.idea.maven - [WARNING] tiles-maven-plugin in project smx3:smx3.templates:14.1.121-SNAPSHOT requested for same tile dependency com.smxemail.tiles:com.smxemail.tiles.release:[2.0.0,3.0.0)
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?
When using the flatten-maven-plugin, tiles cannot be used as the plugin requires a "pom" packaging parent as it's resolving the tiles PROJECT pom, not the TILE itself.
[ERROR] Invalid packaging for parent POM com.theoryinpractise:halbuilder-release-tile:
1.0.4-SNAPSHOT, must be "pom" but is "tile" @ com.theoryinpractise:halbuilder-release-tile:
1.0.4-SNAPSHOT
It's possible we could get around this by injecting the parent with the tile classifer/type so the artifact gets resolved rather than the project pom.
Under tiles-maven-plugin 2.2 using a multi-module project, maven reports a warning for duplicate tiles.
[WARNING] tiles-maven-plugin in project smx3:smx3.agreement:14.1.74-SNAPSHOT requested for same tile dependency com.smxemail.tiles:com.smxemail.tiles.enforcements:[1.0.0,2.0.0)
[WARNING] tiles-maven-plugin in project smx3:smx3.agreement:14.1.74-SNAPSHOT requested for same tile dependency com.smxemail.tiles:com.smxemail.tiles.osgiservices:[1.0.0,2.0.0)
The builds all seem to build fine however...
I'm attempting to use this plugin on a spring boot project and I'm getting this exception when it runs:
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: no model resolver provided, cannot resolve parent POM org.springframework.data.build:spring-data-build:1.5.2.RELEASE for POM org.springframework.data:spring-data-releasetrain:Evans-SR2
A similar issue seems to have been ran into by another plugin doing some different maven hackery:
https://jira.codehaus.org/browse/MOJO-2032
Some comments on that issue seem to indicate the issue is related to the scope=import dependencies in the dependencyManagement section of spring-boot-dependencies.
Update the README.adoc
file with information on the fact that tiles rewrites plugin execution ids to give identification of the tile it was defined in, also add documentation for how disable the behaviour once #12 has been applied.
In a multimodule Maven project the site is generated fine (mvn site) but when we run the site:stage goal the modules are created under the tile.artifactId/module.artifactId.
The versions 1.7, 1.8 and 1.9-SNAPSHOT are affected.
Supposse the following multimodule Maven project:
myproject
|- pom.xml
|- module1
| |- pom.xml
|- module2
| |- pom.xml
And suppose myproject/pom.xml is configured as:
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>mytile.group:my-aggregated-tile:1.0.0-SNAPSHOT</tile>
</tiles>
</configuration>
</plugin>
And the tile is:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>javadoc</report>
<report>test-javadoc</report>
</reports>
</reportSet>
<reportSet>
<id>aggregate</id>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
The expected staged site is as follows:
myproject
|- target
| |- staging
| | |- index.html
| | |- module1
| | | |- index.html
| | |- module2
| | | |- index.html
But we get:
myproject
|- target
| |- staging
| | |- index.html
| | |- my-aggregated-tile
| | | |- module1
| | | | |- index.html
| | | |- module2
| | | | |- index.html
The tiles plugin does not seem to resolve version ranges correctly when used together with the go-offline goal for the dependency plugin.
I created a pom like this:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>myCompany</groupId>
<artifactId>myArtifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>1.8</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Then I ran
mvn dependency:go-offline
[INFO] Plugin Resolved: tiles-maven-plugin-1.8.jar Downloading: http://my-server/nexus/content/groups/public/org/apache/maven/shared/maven-filtering/%5B1.3,1.3%5D/maven-filtering-%5B1.3,1.3%5D.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.241 s [INFO] Finished at: 2015-10-21T19:57:26+02:00 [INFO] Final Memory: 22M/699M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:resolve-plugins (resolve-plugins) on project myArtifact: Nested: Could not find artifact org.apache.maven.shared:maven-filtering:jar:[1.3,1.3] in central-mirror (http://my-server/nexus/content/groups/public)
When using a parent, groupId and version can be missing in a child module if this module has the same parent pom value for this attributes.
But when using tiles plugin, this feature doesn't work because of this code (src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy @ line 296) :
if (model.artifactId == project.artifactId && model.groupId == project.groupId
&& model.version == project.version && model.packaging == project.packaging) {
injectTilesIntoParentStructure(tiles, model, request)
}
The workaround is obviously to redefine groupId and version in the child module but this isn't documented (or i missed it?) and no log are emitted making very difficult to kown why tile doesn't work.
It seems some change between 2.7 and 2.8 has broken the usage of the flatten-maven-plugin
when publishing to oss.sonatype.org
:
Invalid POM: /com/theoryinpractise/halbuilder-styleguide-tile/1.0.4/halbuilder-styleguide-tile-1.0.4.pom: License information missing, SCM URL missing, Developer information missing
NetBeans recognizes there is a custom build component and frets, but as long as dependencies are not in your tiles, it just doesn't discover the plugins and present them to you. It does build with tiles fine, so development is not affected.
Hi,
I'm currently evaluating tiles for our big restructuring of our maven project, and so far it seems really good! But there is one feature that I haven't seen in the documentation, and wonder if it is possible or not.
Our tiles will all be part of the same project structure, basically with all the tiles in a tiles-subfolder in the directory of the project. And we would prefer if we didn't have to install the tiles before using them. Is this possible? Ie making the tile plugin use the files on disk (ie not a repository, not even the local on one the machine) directly? For example, using something similar to the tag that can be used in the section of a pom. We plan to have all our tiles as snapshots.
So, basically, we want to be able to do this:
Regards
/Jimi
One issue I've been hitting lately, and usually only affects the command line usage, but has recently started rearing its head in IntelliJ again is that the fact we're injecting and mutating the parents of tiles in a global namespace manner.
For single module projects this works fine, but the moment you use a reactor, or have multiple POMs configured in a single IntelliJ project the problem of circularly parents arrises.
This can be mitigated by always keeping your tiles ALWAYS in the same order, but this also only works if only always have the same tiles as well, the moment you omit one you risk changing the ordering.
This is primarily only a problem in IntelliJ ( unless your doing a reactor/multi-module build ) it only affects code completion/resolution ( but that in turn can prevent one from running tests or debugging as IntelliJ can no longer compile code ).
You cannot specify a packaging Maven doesn't inherently understand because it attempts to resolve everything first time through.
This is a reminder to see if we can override the packaging when we attempt to resolve the model the second time. Such as with a setting
It would be good to (optionally) support filter of the tile.xml
file, so that properties of the Maven Project can be embedded in the deployed tile - such as @project.version@
.
This will be especially handy when using the attach-tile
goal along side an existing maven plugin project, where the tile wants to refer to the plugin version being released.
With the change to use the tile
artifact type in 2.1, it appears we (I) was premature in actually releasing it. Since ones tile project is of the packaging tile
, and we only attach artifacts ( rather than set a primary artifact) the maven-install-plugin
calls "install project" on the attached artifact, which in turn forces it to deploy as a .pom
file - which then can't be downloaded unless :pom:
explicitly specified.
We should actually set the the projects primary artifact, rather than just attach an additional file.
Hi there,
I have a feature request: if the POM which you add the maven-tiles plugin to inherits its ${project.version}
from its parent, copy it to the POM so that its version isn't inherited from the tile POM.
<project>
<parent>
<groupId>com.example.com</groupId>
<artifactId>parent-artifact</artifactId>
<version>3</version>
</parent>
<artifactId>child-artifact</artifactId>
..
</project>
The point is that child-artifact hasn't explicitly set its version, it inherits it from parent-artifact. Now, when mvn runs, maven-tils injects the tile.xml as the new parent and the version in child-artifact now becomes whatever is defined in the tile's POM. I suggest that maven-tiles sets the version in child-artifact to 3 (if it hasn't specified one) after perfoming the parent POM injection.
I believe this would improve maven-tiles' user friendliness.
Cheers,
-Torstein
Example:
[INFO] Scanning for projects...
---------------------------------------------------
constituent[0]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/aether-api-1.13.1.jar
constituent[1]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/aether-connector-wagon-1.13.1.jar
constituent[2]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/aether-impl-1.13.1.jar
constituent[3]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/aether-spi-1.13.1.jar
constituent[4]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/aether-util-1.13.1.jar
constituent[5]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/commons-cli-1.2.jar
constituent[6]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/commons-io-2.2.jar
constituent[7]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/commons-lang-2.6.jar
constituent[8]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-aether-provider-3.0.5.jar
constituent[9]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-artifact-3.0.5.jar
constituent[10]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-compat-3.0.5.jar
constituent[11]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-core-3.0.5.jar
constituent[12]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-embedder-3.0.5.jar
constituent[13]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-model-3.0.5.jar
constituent[14]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-model-builder-3.0.5.jar
constituent[15]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-plugin-api-3.0.5.jar
constituent[16]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-repository-metadata-3.0.5.jar
constituent[17]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-settings-3.0.5.jar
constituent[18]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/maven-settings-builder-3.0.5.jar
constituent[19]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/plexus-cipher-1.7.jar
constituent[20]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/plexus-component-annotations-1.5.5.jar
constituent[21]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/plexus-interpolation-1.14.jar
constituent[22]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/plexus-sec-dispatcher-1.3.jar
constituent[23]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/plexus-utils-2.0.6.jar
constituent[24]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/sisu-guava-0.9.9.jar
constituent[25]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/sisu-guice-3.1.0-no_aop.jar
constituent[26]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/sisu-inject-bean-2.3.0.jar
constituent[27]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/sisu-inject-plexus-2.3.0.jar
constituent[28]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/wagon-file-2.8.jar
constituent[29]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/wagon-http-2.8-shaded.jar
constituent[30]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/wagon-http-shared-2.8.jar
constituent[31]: file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2014.1.4/plugins/maven/lib/maven3/lib/wagon-provider-api-2.8.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getAllProjects()Ljava/util/List;
at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.afterProjectsRead(TilesMavenLifecycleParticipant.groovy:223)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
I'm hitting an annoying situation where I have 10+ modules included in my IDEA project, each use a selection of 3-4 tiles ( the same ones ) but it different orders.
Since IntelliJ runs everything in the same maven session, the same ModelCache is being used, and since we mutate the parents of artifacts to build the artifact chain, this causes all manner of oddities in IntelliJ ( most evident if you include dependencies in any of your tiles ).
I wonder if we can somehow cache multiple copies of the effective-tile ( i.e. a per-project tile ).
This is my configuration:
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.7</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.jeppesen.jcms:aggregate-tile:tile::[1.0.3, 2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
After upgrading from 1.5 to 2.7 I get the following error message:
Failure to find group:artifact:xml:1.2.3 in http://nexusserver/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of central-mirror has elapsed or updates are forced
This is indeed correct, because my tiles are not of packaging type "xml" but packaging type "tile".
From what I can see on the front page, the packaging for tiles should still be "tile", so what is happening here?
Looking at other versions this seems to be moving around a bit. The last version I get to resolve correctly is 1.8.
In 2.1 it looks like this:
groupid:artifactid:tile:tile-pom:1.2.3
That fails, because the version is not "tile" and the packaging is not "tile-pom"
2.2 and upwards has the same behavior as 2.7.
The readme.md talks about composite poms. It would benefit a great deal from an example of this; it is just a pom that declares some dependencies and is used with <type>pom</type> <scope>import</scope>
?
I know that an issue is not a great place to have an argument, so please forgive the following.
I have a raft of projects with a lengthy, identical, list of dependencies. If you want to write a pax-exam test, you need all these dependencies. scope=import is only permitted in dependencyManagement. So it doesn't solve the DRY pain of all those dependencies, it just subtracts out the versions. I was hoping that I could make a tile for this job, but your forbid in a tile. So what do you recommend?
In one variant of our tiles we define a execution solely for the purposes of disabling the current behavior. However - now that the maven-tiles-plugin
prepends the tile GAV to the execution id, this no longer over-writes the default execution.
So we need a way to disable that, on a case-by-case basis - as part of the tile definition.
I was creating a tile earlier containing a profile, for some optional behaviour, and I noticed that the profile contents was being merged directly into the main pom section, and not retaining its profile-like nature.
Using the dependency:tree
and dependency:list
plugins/goals show no dependencies for projects using tiles:
git:develop·@smx3.rest> mvn dependency:tree amrk@Marks-MacBook-Pro
[INFO] Scanning for projects...
[INFO] model: 'smx3:smx3.rest:2.0.1-SNAPSHOT' has tile 'com.smxemail.tiles:com.smxemail.tiles.enforcements:1.0.1-SNAPSHOT' as new parent.
model: 'com.smxemail.tiles:com.smxemail.tiles.enforcements:1.0.1-SNAPSHOT' has tile 'com.smxemail.tiles:com.smxemail.tiles.osgiapi:1.0.5' as new parent.
model: 'com.smxemail.tiles:com.smxemail.tiles.osgiapi:1.0.5' has tile 'com.smxemail.tiles:com.smxemail.tiles.karaffeature:1.0.1' as new parent.
model: 'com.smxemail.tiles:com.smxemail.tiles.karaffeature:1.0.1' has original pom 'com.smxemail:com.smxemail.parent:2.1.7' as new parent.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building smx3.rest 2.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) @ smx3.rest ---
[INFO] smx3:smx3.rest:jar:2.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.059 s
[INFO] Finished at: 2014-09-29T10:38:57+13:00
[INFO] Final Memory: 20M/310M
[INFO] ------------------------------------------------------------------------
Version 1.3 of plugin returns dependency list/tree as expected. So it looks like it may be related to our parent rewriting in 1.4.
If you creating a "release tile" which you wish to use with oss.sonatype.org, you need to get around their strict POM validation rules. One way of doing this is with the flatten-maven-plugin.
We should document this in the README.
When following the README guide for defining a tile using itself a nexus-release-tile, I get an error when trying to deploy the project.
pom.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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.maven.tiles</groupId>
<artifactId>test-tile</artifactId>
<packaging>tile</packaging>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.2</version>
<extensions>true</extensions>
<configuration>
<filtering>false</filtering>
<tiles>
<tile>com.example.maven.tiles:nexus-release-tile:[1.0, 2)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
on mvn deploy
, I get the following error :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project test-tile: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
But with mvn help:effective-pom
, I effectively see the distributionManagement section.
PS : on mvn deploy
, the log clearly says that the nexus-release-tile
is mixed in the pom.
The plugin makes a tile as parent, and then makes the original parent on the top of tile. So that the distributionManagement of original parent doesn't be overrided by tile.
I suppose the tile will be the top of original parent, so that the distributionManagement can be overrided.
I've been trying to get maven-tiles working across several projects. In a project with no parent and no modules it works very nicely. But applying the same plugin config to either the parent or a child of a multi-module component maven-tiles does not have any effect (nor does it print its reassuring 'tiles-maven-plugin: Injecting 3 tiles as intermediary parent artifact's...').
I took from #22 that something should work. Even if I have to copy the maven-tiles plugin config into each sub-module we'd still get heaps out of this plugin.
I've tried with maven-tiles 1.8 on maven 3.0.5, and 3.3.3.
<plugin>
<extensions>true</extensions>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>1.8</version>
<inherited>true</inherited>
<configuration>
<tiles>
<tile>nz.co.eroad:checkstyle-level2-tile:1.0.0</tile>
</tiles>
</configuration>
</plugin>
Tiles are currently attached as pom
artifacts, which triggers oss.sonatype.org's standard POM validation rules - which fail since a tile is a partial POM.
Looks like MavenSession#getAllProjects
is a not a blessed method and even carries a comment of:
/** This is a provisional method and may be removed */
It looks like this was actually removed in the upcoming Maven 3.3.7 release, and also not available in the version of Maven IntelliJ IDEA ships with by default.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.