use of org.apache.maven.plugins.ear.util.ModuleIdentifierValidator in project maven-plugins by apache.
the class ModuleIdentifierValidatorTest method before.
@Before
public void before() {
this.earModules = new ArrayList<EarModule>();
this.miv = new ModuleIdentifierValidator(this.earModules);
}
use of org.apache.maven.plugins.ear.util.ModuleIdentifierValidator in project maven-plugins by apache.
the class EarMojo method checkModuleUniqueness.
private void checkModuleUniqueness() throws MojoExecutionException {
ModuleIdentifierValidator miv = new ModuleIdentifierValidator(getModules());
miv.checkForDuplicateArtifacts();
if (miv.existDuplicateArtifacts()) {
Map<String, List<EarModule>> duplicateArtifacts = miv.getDuplicateArtifacts();
for (Entry<String, List<EarModule>> entry : duplicateArtifacts.entrySet()) {
getLog().warn("The artifactId " + entry.getKey() + " exists more than once in the modules list.");
for (EarModule earModule : entry.getValue()) {
getLog().warn(" --> " + earModule.getArtifact().getId() + " (" + earModule.getType() + ")");
}
}
getLog().warn("HINT: This can be simply solved by using the <fileNameMapping>full</fileNameMapping>");
if (duplicateArtifactsBreakTheBuild) {
// CHECKSTYLE_OFF: LineLength
throw new MojoExecutionException("The build contains duplicate artifacts which result in unpredictable ear content.");
// CHECKSTYLE_ON: LineLength
}
}
}
Aggregations