Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable-jar is accidentally triggered for Boot dist-zip bundle #97

Open
3 tasks
dmikusa opened this issue Mar 31, 2022 · 0 comments
Open
3 tasks

Executable-jar is accidentally triggered for Boot dist-zip bundle #97

dmikusa opened this issue Mar 31, 2022 · 0 comments
Labels
type:bug A general bug

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Mar 31, 2022

What happened?

  • What were you attempting to do?

When building the sample application from source, the executable-jar buildpack is triggered and adds potentially invalid process types.

...
  Removing source code
  Restoring application artifact

Paketo Executable JAR Buildpack 6.2.0
  https://github.com/paketo-buildpacks/executable-jar
  Process types:
    executable-jar: java -jar /workspace/demo-boot-0.0.1-SNAPSHOT/lib/demo-0.0.1-SNAPSHOT.jar (direct)
    task:           java -jar /workspace/demo-boot-0.0.1-SNAPSHOT/lib/demo-0.0.1-SNAPSHOT.jar (direct)
    web:            java -jar /workspace/demo-boot-0.0.1-SNAPSHOT/lib/demo-0.0.1-SNAPSHOT.jar (direct)

Paketo DistZip Buildpack v5.2.0-8-g2f28446
  https://github.com/paketo-buildpacks/dist-zip
  Build Configuration:
    $BP_APPLICATION_SCRIPT   */bin/*  the application start script
    $BP_LIVE_RELOAD_ENABLED  false    enable live process reload in the image
  Process types:
    dist-zip: /workspace/demo-boot-0.0.1-SNAPSHOT/bin/demo
    task:     /workspace/demo-boot-0.0.1-SNAPSHOT/bin/demo
    web:      /workspace/demo-boot-0.0.1-SNAPSHOT/bin/demo

The impact should be minimal because dist-zip runs next and overwrites two of the three process types, the most commonly used ones task and web.

Build Configuration

To reproduce, build the sample dist-zip app with pb dist-zip -b docker.io/paketo-buildpacks/java:latest --env BP_GRADLE_BUILD_ARGUMENTS="--no-daemon -x test bootDistZip" --env BP_GRADLE_BUILT_ARTIFACT="build/distributions/demo-boot-0.0.1-SNAPSHOT.zip".

The issue is caused because the demo-boot-*.zip file contains an executable JAR within it. The executable JAR buildpack sees that and tries to add process types for it. If you switch BP_GRADLE_BUILT_ARTIFACT="build/distributions/demo-0.0.1-SNAPSHOT.zip" you can bypass this issue because the bundled JAR will no longer be executable.

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.
@dmikusa dmikusa added the type:bug A general bug label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant