remove plugin management from bad smells as enforcer, scm and release are normally plugin managemented.

This commit is contained in:
Richard Vowles
2014-08-02 14:16:39 +12:00
parent c38da4d424
commit 56ee4ebe42
5 changed files with 6 additions and 13 deletions

View File

@@ -71,7 +71,7 @@ class TileValidator {
} }
if (model.build?.pluginManagement) { 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) { if (model.dependencies) {

View File

@@ -67,11 +67,10 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
public static final TILEPLUGIN_ARTIFACT = 'tiles-maven-plugin' public static final TILEPLUGIN_ARTIFACT = 'tiles-maven-plugin'
public static final String SMELL_DEPENDENCYMANAGEMENT = "dependencymanagement" public static final String SMELL_DEPENDENCYMANAGEMENT = "dependencymanagement"
public static final String SMELL_DEPENDENCIES = "dependencies" 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_REPOSITORIES = "repositories"
public static final String SMELL_PLUGINREPOSITORIES = "pluginrepositories" public static final String SMELL_PLUGINREPOSITORIES = "pluginrepositories"
public static final List<String> SMELLS = [SMELL_DEPENDENCIES, SMELL_DEPENDENCYMANAGEMENT, SMELL_PLUGINMANAGEMENT, public static final List<String> SMELLS = [SMELL_DEPENDENCIES, SMELL_DEPENDENCYMANAGEMENT,
SMELL_PLUGINREPOSITORIES, SMELL_REPOSITORIES] SMELL_PLUGINREPOSITORIES, SMELL_REPOSITORIES]
@Requirement @Requirement
@@ -281,7 +280,7 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
} }
/** /**
* In the context of * Cleans the model of untagged bad build smells.
* @param model * @param model
*/ */
protected void cleanModel(Model model) { protected void cleanModel(Model model) {
@@ -295,11 +294,6 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
model.dependencies = null 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/ // 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)) { if (!collectedBuildSmells.contains(SMELL_REPOSITORIES)) {
model.repositories = null model.repositories = null

View File

@@ -176,7 +176,7 @@ public class TilesMavenLifecycleParticipantTest {
runMergeTest("com.bluetrainsoftware.maven.tiles:bad-smelly-tile:1.1-SNAPSHOT") runMergeTest("com.bluetrainsoftware.maven.tiles:bad-smelly-tile:1.1-SNAPSHOT")
} }
assert t.message.startsWith("Discovered bad smell configuration [unknown] from <buildStink>pluginmanagement,dependencymanagement,dependencies,repositories,unknown</buildStink> in") assert t.message.startsWith("Discovered bad smell configuration [unknown] from <buildStink>dependencymanagement,dependencies,repositories,unknown</buildStink> in")
println t.message println t.message
} }
@@ -187,7 +187,6 @@ public class TilesMavenLifecycleParticipantTest {
assert !model.pluginRepositories assert !model.pluginRepositories
assert !model.dependencies assert !model.dependencies
assert !model.dependencyManagement assert !model.dependencyManagement
assert !model.build.pluginManagement
} }

View File

@@ -22,7 +22,7 @@
<groupId>io.repaint.maven</groupId> <groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId> <artifactId>tiles-maven-plugin</artifactId>
<configuration> <configuration>
<buildSmells>pluginmanagement,dependencymanagement,dependencies,repositories,unknown</buildSmells> <buildSmells>dependencymanagement,dependencies,repositories,unknown</buildSmells>
<tiles> <tiles>
<tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile> <tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile>
<tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile> <tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile>

View File

@@ -22,7 +22,7 @@
<groupId>io.repaint.maven</groupId> <groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId> <artifactId>tiles-maven-plugin</artifactId>
<configuration> <configuration>
<buildSmells>pluginmanagement,dependencymanagement,dependencies,repositories,pluginrepositories</buildSmells> <buildSmells>dependencymanagement,dependencies,repositories,pluginrepositories</buildSmells>
<tiles> <tiles>
<tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile> <tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile>
<tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile> <tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile>