Comments (8)
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.
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.
@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.
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.
@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.
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.
@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.
@dmikusa understood.
Thanks for your time. I'll close the issue.
from bellsoft-liberica.
Related Issues (20)
- When using jlink, we can't use --add-modules ALL-MODULE-PATH HOT 1
- github bellsoft-jre17.0.5+8-linux-amd64.tar.gz x509: certificate signed by unknown authority HOT 4
- Support JDK 20 HOT 1
- I'm waiting patiently for BP_JVM_VERSION of 20 :-) HOT 4
- gradle `bootBuildImage` fails due to paketo-buildpacks/bellsoft-liberica HOT 3
- No valid JRE available HOT 2
- Does remote debug support for bellsoft NIK? HOT 1
- Native memory tracking can't be disabled HOT 2
- The CI updater for Java 11 NIK is failing HOT 1
- Add support for `JDK_JAVA_OPTIONS` HOT 1
- Support for JVM-based apps using musl based JVM & the static stack HOT 5
- Get Error when trying to build an image from spring-boot's maven plugin in a java 21 project HOT 2
- can't download form download.bell-sw.com HOT 8
- Add Support for CRaC enabled JDK Distributions HOT 9
- Automatic Thread Count
- No builldpack.toml found in bellsoft-liberica 10.5.2 HOT 2
- Get Error when trying to build an image from a plain maven Java 21 project HOT 3
- Support JDK 22 HOT 9
- Go should be upgraded; currently using 1.20 which is EOL and has security issues HOT 2
- `Disables JVM DNS caching if link-local DNS is available` does not work HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bellsoft-liberica.