Maven-war-plugin doubles manifest.mf

I have a wab-web application (osgi) package and I need my custom manifest. I found a solution on the Internet - we create src / main / resources / META-INF / MANIFEST.MF in pom too:

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>       
 <version>2.3</version><br>
 <configuration>
 <archive>
  <manifestFile>
   ${project.build.outputDirectory}/META-INF/MANIFEST.MF     
  </manifestFile>
</archive>
</configuration>
</plugin>

But when I use it in the final war, I have two MANIFESTOS. MF

  • /META-INF/MANIFEST.MF
  • /WEB-INF/classes/META-INF/MANIFEST.MF

I found a solution to this problem:

<packagingExcludes>/WEB-INF/classes/META-INF/</packagingExcludes>

But I want to know the reason - why ?. This is mistake? O Am I not understanding something or is something wrong?

+4
source share
1 answer

/WEB-INF/classes/META-INF/MANIFEST.MF comes from src / main / resources / META-INF / MANIFEST.MF (maven is copied, like any other file located in the resource folder)

/META-INF/MANIFEST.MF maven-war-plugin

, ... manifest.mf ..

, !

+1

Source: https://habr.com/ru/post/1534778/


All Articles