mirror of
https://github.com/bmlong137/maven-tiles
synced 2025-09-10 14:11:08 +00:00
remove plugin management from bad smells as enforcer, scm and release are normally plugin managemented.
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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<String> SMELLS = [SMELL_DEPENDENCIES, SMELL_DEPENDENCYMANAGEMENT, SMELL_PLUGINMANAGEMENT,
|
||||
public static final List<String> 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
|
||||
|
@@ -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 <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
|
||||
}
|
||||
@@ -187,7 +187,6 @@ public class TilesMavenLifecycleParticipantTest {
|
||||
assert !model.pluginRepositories
|
||||
assert !model.dependencies
|
||||
assert !model.dependencyManagement
|
||||
assert !model.build.pluginManagement
|
||||
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<buildSmells>pluginmanagement,dependencymanagement,dependencies,repositories,unknown</buildSmells>
|
||||
<buildSmells>dependencymanagement,dependencies,repositories,unknown</buildSmells>
|
||||
<tiles>
|
||||
<tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile>
|
||||
<tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile>
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<buildSmells>pluginmanagement,dependencymanagement,dependencies,repositories,pluginrepositories</buildSmells>
|
||||
<buildSmells>dependencymanagement,dependencies,repositories,pluginrepositories</buildSmells>
|
||||
<tiles>
|
||||
<tile>groupid:antrun1-tile:1.1-SNAPSHOT</tile>
|
||||
<tile>groupid:antrun2-tile:1.1-SNAPSHOT</tile>
|
||||
|
Reference in New Issue
Block a user