private void createExclusion(MavenArtifact artifactToExclude, MavenDomExclusions exclusions) { MavenDomExclusion exclusion = exclusions.addExclusion(); exclusion.getGroupId().setValue(artifactToExclude.getGroupId()); exclusion.getArtifactId().setValue(artifactToExclude.getArtifactId()); }