MavenDomPlugin (MavenDomPlugins mavenDomPlugins) { if (model.equals(mavenDomPlugins.getParentOfType(MavenDomProjectModel.class, true))) { if (plugin.getParentOfType(MavenDomPluginManagement.class, false) != null) { return null; } } for (MavenDomPlugin domPlugin : mavenDomPlugins.getPlugins()) { if (MavenPluginDomUtil.isPlugin(domPlugin, groupId, artifactId)) { return domPlugin; } } return null; }