paketo-buildpacks / spring-boot

A Cloud Native Buildpack that contributes Spring Boot dependency information and slices an application into multiple layers
Apache License 2.0
170 stars 22 forks source link

Broken detection logic on non-spring projects #474

Closed modulo11 closed 4 months ago

modulo11 commented 4 months ago

Expected Behavior

The buildpack should not kick in for non Spring-Boot apps.

Current Behavior

Building the war sample using

pack build --clear-cache --builder paketobuildpacks/builder-jammy-base --env BP_JVM_VERSION=11 --buildpack gcr.io/paketo-buildpacks/java:13.0.0 sample-war

currently fails with

Paketo Buildpack for Spring Boot 5.29.0
  unable to find Spring Boot Executable Jar
  open : no such file or directory
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

Possible Solution

The logic seems to be complicated and probably needs an early return if the app is not using spring-boot.

Steps to Reproduce

  1. Clone samples
  2. Run pack build using the latest release

Motivations

dmikusa commented 4 months ago

Acknowledged. @paketo-buildpacks/java-maintainers looking into it.