0

I'm experiencing a behavior whereby this configuration of spring-boot-maven-plugin:

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
.....    

results in the following (shortened) manifest.mf file produced inside the jar:

Manifest-Version: 1.0
Implementation-Vendor: Pivotal Software, Inc.
Implementation-Title: submit-enrollment
Implementation-Version: 0.0.1-SNAPSHOT
Implementation-Vendor-Id: c.z.services
Built-By: sl
Build-Jdk: 1.7.0_76
Created-By: Apache Maven 3.2.5
Archiver-Version: Plexus Archiver

which results in a defective jar impossible to run.

As soon as I remove the pluginManagement tag from the pom.xml, the resulting manifest changes to the following fuller version and all is good during the jar execution:

Manifest-Version: 1.0
Implementation-Vendor: Pivotal Software, Inc.
Implementation-Title: submit-enrollment
Implementation-Version: 0.0.1-SNAPSHOT
Implementation-Vendor-Id: c.z.services
Built-By: sl
Build-Jdk: 1.7.0_76
Start-Class: c.z.submit.enrollment.SubmitEnrollmentApplication
Created-By: Apache Maven 3.2.5
Spring-Boot-Version: 1.2.5.RELEASE
Main-Class: org.springframework.boot.loader.JarLauncher
Archiver-Version: Plexus Archiver

According to the plugin's docs, the pluginManagement tag is expected:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>1.2.5.RELEASE</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>

So, what's the correct usage pattern of this plugin in the pom.xml file which produces correct deployable artifact?

Thanks!

Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82
  • So you work at pivotal? :-p You need it in the plugin section, as well as the plugin management section. – Carlos Bribiescas Aug 17 '15 at 17:48
  • @CarlosBribiescas ;-) Pivotal is what gets put their by the spring-boot-maven-plugin by default. Would you happen to know how to change the Implementation-Vendor value? – Simeon Leyzerzon Aug 17 '15 at 18:30
  • What version of Spring Boot are you using? I find your report very puzzling. When you remove the `pluginManagement` what version of the plugin is used? – Stephane Nicoll Aug 17 '15 at 18:57
  • Spring Boot just takes the value of your original manifest (created by the regular jar plugin) `Pivotal Software, Inc.` comes from the name of the organization of the parent pom. Just specify your own organization (see https://maven.apache.org/shared/maven-archiver/examples/manifest.html) – Stephane Nicoll Aug 17 '15 at 19:02
  • @StéphaneNicoll: I was missing the plugin section (as pointed out by CarlosBribiescas comment) in my pom.xml and the behavior described was attributable to that. Once I added spring-boot-maven-plugin under both and / section it started to work as expected. As for your second suggestion - adding / in the pom.xml did the trick - thanks for the prompt response. If it matters - I'm willing to approve the answers as accepted for posterity ;-) – Simeon Leyzerzon Aug 17 '15 at 19:52
  • I am not really answering your initial question. And to be clear, I still don't understand what your problem was with the "corrupted manifest". If you don't provide any version, it should still work even though you should provide the version has maven reminds you with a warning if you don't. – Stephane Nicoll Aug 18 '15 at 07:23

0 Answers0