-
Notifications
You must be signed in to change notification settings - Fork 14
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
[feature request] support multiple artifacts of different types. #76
Comments
Hi guys. I am taking a look at this issue. here are my thoughts about it. The env I did the following test with the Quarkus getting-started guide:
What I can understand is the following Am I going in the right direction? |
I've been thinking about a possible solution to this issue, here is one idea. Based on my previous comment What about adding a new environment variable
With this solution we can:
|
Hi guys, I would like to share some news about this issue. I tried to take advantage of the maven assembly plugin the idea is to have distribution xml in the maven paketo buildpack and inject that one during building time (not sure how to inject it yet). The distribution xml is going to create a .zip from the output folder defined by the user. This is an example.
Important to notice
The output is actually the file getting-started-1.0.0-SNAPSHOT-bin.zip with all the files needed to create the native-image, this file is send to the native-image buildpack |
Yes, so after the artifact resolver locates the artifact, it will copy it to a layer. This is what allows us to persist the artifact across builds and cache it. There is an assumption that the item saved is a zip file (EAR/WAR/JAR typically, but not enforced). What then happens is that we delete all of the application source code (basically There are two ways that we can make this work:
I'd like to go with option #2, but I need to see how much additional effort this requires. After adding this support I think that having a single artifact will still remain the most common use case, so I worry about the case where someone accidentally has multiple artifacts. This has been something that happens with Gradle projects. If you build locally, then build with buildpacks, you can end up with multiple archives in the build folder. If we change the behavior to support multiple artifacts, we'll need to be careful how we handle this use case. I could potentially see adding some protections here, like an env variable |
Hi @dmikusa-pivotal , Thanks for the reply, I just created a draft PR. the PR is addressing the idea #1 but in order to do that I am using the maven assembly plugin. I haven't add unit tests yet, but I would like to get any feedback regarding the approach. To enable the feature I added the following environment variable |
@jjbustamante It's awesome that you were able to get this working with the Maven assembly plugin, and thanks for wrapping that up in a PR but we can't accept that PR. I should have explained this better in my previous post, sorry. The functionality I was walking through is not in the Maven buildpack. It's actually part of libbs, which is a library that we share across all of our build-system style buildpacks (Maven, Gradle, SBT, Clojure Tools, etc...). If we make a change to support multiple artifacts, it has to be done in libbs so that it works across all of the build systems we support. Using a specific Maven plugin to achieve this is only going to work for Maven. A PR for this is going to have to update libbs:
It's a lot of work, definitely jumping into the deep end of the pool on this PR. If you want to give it a shot, give me a 👍. Otherwise, I'll probably have time to work on this issue next week. |
It's ok if the PR can't be merged, I understand the reasons for me was a great way to learn the internal details of the Buildpack implementations. I can give it a shot to the changes in the Right now, I am working in some changes in the native-image Buildpack, those changes assume all the artifacts requiere to build the image are in the /workspace, let me create a draft PR of those changes so you can give me feedback on that, then I will take a look on experimenting on |
Fantastic, I'll keep an eye out for some PRs. If you have questions, don't hesitate to reach out. Happy to discuss more. Our Slack is a good place for discussions like this. If you're on Slack, we're at https://paketobuildpacks.slack.com. All are welcome to join. |
This support was added as part of the upgrade to libbs 1.11.0. This PR adds documentation for the feature. Resolves #76. Signed-off-by: Daniel Mikusa <[email protected]>
What happened?
The maven buildpack is expecting a single build artifact of type either jar or war, which can be explicitly configured using
BP_MAVEN_BUILT_ARTIFACT
.This artifact will be extracted and passed on to downstream buildpacks, like the native image buildpack.
The argument
BP_MAVEN_BUILD_ARGUMENTS="-Dmaven.test.skip=true -Dquarkus.package.type=native-sources package"
, to create Quarkus native image sources for a separate native image build, will generate multiple artifacts that are required to build a native image eventually with the native image buildpack:A potential solution for this usecase, and maybe others, is to allow passing a list of artifacts to
BP_MAVEN_BUILT_ARTIFACT
, which items are either extracted (jar or war) or copied (e.g. lib folder)Build Configuration
What platform (
pack
,kpack
,tekton
buildpacks plugin, etc.) are youusing? Please include a version.
What buildpacks are you using? Please include versions.
TBS
Checklist
The text was updated successfully, but these errors were encountered: