diff --git a/src/main/groovy/io/repaint/maven/tiles/TileValidator.groovy b/src/main/groovy/io/repaint/maven/tiles/TileValidator.groovy index cc97a37..9b1c288 100644 --- a/src/main/groovy/io/repaint/maven/tiles/TileValidator.groovy +++ b/src/main/groovy/io/repaint/maven/tiles/TileValidator.groovy @@ -71,7 +71,7 @@ class TileValidator { } if (model.build?.pluginManagement) { - log.warn("Rethink your tiles if you feel you need pluginManagement.") + log.warn("Plugin management is usually not required, if you want a plugin to always run, use plugins instead.") } if (model.dependencies) { diff --git a/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy b/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy index e3c5625..8a9a41a 100644 --- a/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy +++ b/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy @@ -67,11 +67,10 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic public static final TILEPLUGIN_ARTIFACT = 'tiles-maven-plugin' public static final String SMELL_DEPENDENCYMANAGEMENT = "dependencymanagement" public static final String SMELL_DEPENDENCIES = "dependencies" - public static final String SMELL_PLUGINMANAGEMENT = "pluginmanagement" public static final String SMELL_REPOSITORIES = "repositories" public static final String SMELL_PLUGINREPOSITORIES = "pluginrepositories" - public static final List SMELLS = [SMELL_DEPENDENCIES, SMELL_DEPENDENCYMANAGEMENT, SMELL_PLUGINMANAGEMENT, + public static final List SMELLS = [SMELL_DEPENDENCIES, SMELL_DEPENDENCYMANAGEMENT, SMELL_PLUGINREPOSITORIES, SMELL_REPOSITORIES] @Requirement @@ -281,7 +280,7 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic } /** - * In the context of + * Cleans the model of untagged bad build smells. * @param model */ protected void cleanModel(Model model) { @@ -295,11 +294,6 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic model.dependencies = null } - // no longer necessary - if (!collectedBuildSmells.contains(SMELL_PLUGINMANAGEMENT)) { - model.build?.pluginManagement = null - } - // does this even need explanation? http://blog.sonatype.com/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/ if (!collectedBuildSmells.contains(SMELL_REPOSITORIES)) { model.repositories = null diff --git a/src/test/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipantTest.groovy b/src/test/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipantTest.groovy index aed921d..fe947d5 100644 --- a/src/test/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipantTest.groovy +++ b/src/test/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipantTest.groovy @@ -176,7 +176,7 @@ public class TilesMavenLifecycleParticipantTest { runMergeTest("com.bluetrainsoftware.maven.tiles:bad-smelly-tile:1.1-SNAPSHOT") } - assert t.message.startsWith("Discovered bad smell configuration [unknown] from pluginmanagement,dependencymanagement,dependencies,repositories,unknown in") + assert t.message.startsWith("Discovered bad smell configuration [unknown] from dependencymanagement,dependencies,repositories,unknown in") println t.message } @@ -187,7 +187,6 @@ public class TilesMavenLifecycleParticipantTest { assert !model.pluginRepositories assert !model.dependencies assert !model.dependencyManagement - assert !model.build.pluginManagement } diff --git a/src/test/resources/bad-smelly-tile.xml b/src/test/resources/bad-smelly-tile.xml index f2bbba7..8ba740b 100644 --- a/src/test/resources/bad-smelly-tile.xml +++ b/src/test/resources/bad-smelly-tile.xml @@ -22,7 +22,7 @@ io.repaint.maven tiles-maven-plugin - pluginmanagement,dependencymanagement,dependencies,repositories,unknown + dependencymanagement,dependencies,repositories,unknown groupid:antrun1-tile:1.1-SNAPSHOT groupid:antrun2-tile:1.1-SNAPSHOT diff --git a/src/test/resources/smelly-tile.xml b/src/test/resources/smelly-tile.xml index 2a43d9d..ecbb428 100644 --- a/src/test/resources/smelly-tile.xml +++ b/src/test/resources/smelly-tile.xml @@ -22,7 +22,7 @@ io.repaint.maven tiles-maven-plugin - pluginmanagement,dependencymanagement,dependencies,repositories,pluginrepositories + dependencymanagement,dependencies,repositories,pluginrepositories groupid:antrun1-tile:1.1-SNAPSHOT groupid:antrun2-tile:1.1-SNAPSHOT