Skip to content

Commit 6b4f6e7

Browse files
author
Erwin Tratar
committed
don't overwrite existing MANIFEST.MF if useDefaultManifestFile is set
The MANIFEST.MF might be generated by a previous step, e.g. the bnd-maven-plugin and must not be overwritten if <useDefaultManifestFile> is configured to true
1 parent 0a4e929 commit 6b4f6e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

org.sonatype.m2e.mavenarchiver/src/org/sonatype/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java

+6
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,12 @@ private void reflectManifestGeneration(MavenProject mavenProject, MojoExecution
430430
Xpp3Dom originalConfig = mojoExecution.getConfiguration();
431431
Xpp3Dom customConfig = Xpp3DomUtils.mergeXpp3Dom(new Xpp3Dom("configuration"), originalConfig);
432432

433+
Xpp3Dom useDefaultManifestFile = customConfig.getChild("useDefaultManifestFile");
434+
if (Boolean.parseBoolean(useDefaultManifestFile.getValue()) && manifestFile.exists()) {
435+
//<useDefaultManifestFile>true</useDefaultManifestFile> and Manifest exists -> don't overwrite
436+
return;
437+
}
438+
433439
//Add custom manifest entries
434440
customizeManifest(customConfig, mavenProject);
435441

0 commit comments

Comments
 (0)