Unable to cf push the Spring Boot 2.6.1 app, giving zip: not a valid zip file

Viewed 545

I have created a simple Spring Boot App (2.6.1) with Gradle.

Created an endpoint which is running fine in local.

However when I tried to publish it to pcf using cf pushcommand it's giving zip: not a valid zip file error.

I am using following manifest file

---
applications:
  - timeout: 180
    name: SpringLatest
    instances: 1
    memory: 1G
    disk_quota: 1G
    health-check-type: port
    path: /build/libs/SpringLatest-1.0.0-LOCAL.jar
    buildpacks:
    - https://github.com/cloudfoundry/java-buildpack.git
    env:
      SPRING_PROFILES_ACTIVE: dev
      APP_ENVIRONMENT: dev
      JBP_CONFIG_OPEN_JDK_JRE: '{jre: { version: 11.0.7_10 }}'
      JBP_LOG_LEVEL: DEBUG
      CF_HEALTH_CHECK_TIMEOUT: 1200
      JAVA_OPTS: -Xms512M -Xmx512M
1 Answers

Had same problem while upgrading from Spring boot version 2.5.X to 2.6.X with Maven for dependency management. Resolved this error by excluding repackage goal in maven plugin executions.

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
Related