GithubHelp home page GithubHelp logo

Comments (8)

dmikusa avatar dmikusa commented on September 22, 2024 1

Creating a separate builder will certainly work. You can also use the -b flag to include multiple buildpacks. The first one should be the one that runs.

Ex: pack build -b paketo-buildpacks/bellsoft-liberica:2.0.0 -b paketo-buildpacks/bellsoft-liberica:9.3.7 ...

In this case, both will run detection & pass but at build time only 2.0.0 should actually execute and do anything.

from bellsoft-liberica.

dmikusa avatar dmikusa commented on September 22, 2024

The BP_JVM_VERSION setting is not meant for you to select an exact JVM version. What you have with 8.0.333 is invalid. As is documented in the README, it takes the major version only. There are no plans to change that behavior because at present the buildpacks only ship one version of each major, the latest at the time of release.

Configure the JVM version (e.g. 8, 11, 16).

Perhaps down the road if we're able to support more versions of Java in each buildpack we can adjust things.

Hope that helps clear things up.

from bellsoft-liberica.

semmet95 avatar semmet95 commented on September 22, 2024

@dmikusa Thanks for the clarification. However I even tested with BP_JVM_VERSION set to "14", expecting the builder to choose bellsoft-liberica version 2.0.0 over version 9.3.7, but still running into the same error.
Version 9.3.7 passes detection then throws the same error during the build.

from bellsoft-liberica.

dmikusa avatar dmikusa commented on September 22, 2024

That's not how it works. It won't go back and pick an old buildpack. When you pack build (or build with Spring Boot), you get the present set of buildpacks that are included in the builder that you are using, including the latest Bellsoft Liberica with the latest Java versions. That version of the buildpack is then run, it looks at the env variable and gets the version. It then tries to fetch the dependency for that version, which if it doesn't exist gives the error you're seeing because it doesn't know about that version.

If you need an older version like 14, which you shouldn't use at this point, you would need to go back and manually pick an older version of the buildpack to use, one that shipped with Java 14 support. You'd need to do the same thing if you wanted a very particular version of Java 8 or 11 or 17. Find the buildpack with the version you want, then fix that buildpack in your build (pack build -b).

from bellsoft-liberica.

semmet95 avatar semmet95 commented on September 22, 2024

@dmikusa bellsoft-liberica version 2.0.0 includes java 14 (I'm only using it for testing not actual usage) which is present in my builder, alongside bellsoft-liberica version 9.3.7 (which doesn't have java 14).
The thing is depending on the order in which they are listed in the builder.toml file, we either get that error (if 9.3.7 is listed before 2.0.0) or the build passes (if 2.0.0 is listed before 9.3.7).
The issue I am facing is that even though my builder has multiple bellsoft-liberica versions, including the one I need, the environment variable BP_JVM_VERSION is not helping with selection of the correct version.

from bellsoft-liberica.

dmikusa avatar dmikusa commented on September 22, 2024

The thing is depending on the order in which they are listed in the builder.toml file, we either get that error (if 9.3.7 is listed before 2.0.0) or the build passes (if 2.0.0 is listed before 9.3.7).

Correct and my understanding is that this is the expected behavior. The buildpack lifecycle runs all of the buildpacks. It is responsible for collecting the results from detection and selecting which buildpacks run. It will pick the first successful buildplan that it finds. That's why it's picking based on the order in your builder.

If you want to influence that you can a.) change your builder order or b.) use the pack build -b argument. The -b flag overrides the buildpack order. If you set paketo-buildpacks/[email protected] first then paketo-buildpacks/java@<version in your builder>, it'll create a custom buildplan and you'll see the 2.0.0 run first.

On a different note, I cannot guarantee that 2.0.0 will work with modern versions of paketo-buildpacks/java. We don't test compatibility with older versions. It may or may not. What I would suggest if you need different versions of the JVM is to package your own bellsoft-liberica image. When you do this, you can adjust the dependencies included in buildpack.toml first and make sure it includes all the versions you need.

from bellsoft-liberica.

semmet95 avatar semmet95 commented on September 22, 2024

@dmikusa thanks for the explanation. I was hoping that v9.3.7 doesn't pass the detection at all but it seems the value of BP_JVM_VERSION isn't taken into consideration during the detect phase.
I will try creating a separate builder if I need different versions of the same buildpack.

from bellsoft-liberica.

semmet95 avatar semmet95 commented on September 22, 2024

@dmikusa understood.
Thanks for your time. I'll close the issue.

from bellsoft-liberica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.