in src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java [282:305]
public void execute() throws MojoExecutionException {
if (useDefaultManifestFile) {
throw new MojoExecutionException("You are using 'useDefaultManifestFile' which has been removed"
+ " from the maven-jar-plugin. "
+ "Please see the >>Major Version Upgrade to version 3.0.0<< on the plugin site.");
}
if (skipIfEmpty
&& (!getClassesDirectory().exists() || getClassesDirectory().list().length < 1)) {
getLog().info("Skipping packaging of the " + getType());
} else {
File jarFile = createArchive();
if (hasClassifier()) {
projectHelper.attachArtifact(getProject(), getType(), getClassifier(), jarFile);
} else {
if (projectHasAlreadySetAnArtifact()) {
throw new MojoExecutionException("You have to use a classifier "
+ "to attach supplemental artifacts to the project instead of replacing them.");
}
getProject().getArtifact().setFile(jarFile);
}
}
}