camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Add mvnd build strategy

Open SubhasmitaSw opened this issue 2 years ago • 5 comments

Resolves 2nd part of #2832

Release Note

feat(builder): Add Maven Daemon support

cc @astefanutti

SubhasmitaSw avatar Jul 08 '22 18:07 SubhasmitaSw

RUN temp=$(mktemp -d) \
&& curl -Lso "$temp"/mvnd.zip https://github.com/mvndaemon/mvnd/releases/download/0.8.0/mvnd-0.8.0-linux-amd64.zip \
&& unzip -d "$temp" "$temp"/mvnd.zip \
&& rm -v "$temp"/mvnd.zip \
&& mv "$temp"/mvnd /usr/bin/mvnd \
&& rm -rf "$temp"

This is the current way we are trying to have both the maven and mvnd versions in the operator image by replacing the embedded maven version in mvnd, which is not quite accurate. Do we have any other ways where we can achieve this? @gnodet @ppalaga your suggestions could come handy. Thanks!

SubhasmitaSw avatar Jul 11 '22 15:07 SubhasmitaSw

Not 100% sure what is your aim, @SubhasmitaSw To install mvnd, you need not only the mvnd binary. You also need the mvn directory from the distribution zip and the mvnd binary must be informed where to find that mvn directory via ~/.m2/mvnd.properties or via env. var MVND_HOME.

ppalaga avatar Jul 11 '22 16:07 ppalaga

Not 100% sure what is your aim, @SubhasmitaSw To install mvnd, you need not only the mvnd binary. You also need the mvn directory from the distribution zip and the mvnd binary must be informed where to find that mvn directory via ~/.m2/mvnd.properties or via env. var MVND_HOME.

@ppalaga The Camel K operator image will have both Maven and Maven Daemon. We were wondering whether it's possible to avoid having two Maven versions packaged, that are the standard Maven one and the embedded one into the Maven Daemon distribution. Is there a way to instruct the Maven daemon to use an external Maven installation?

astefanutti avatar Jul 12 '22 07:07 astefanutti

Is there a way to instruct the Maven daemon to use an external Maven installation?

mvnd currently does not support that use case. It would be hard and the result would be very fragile.

ppalaga avatar Jul 12 '22 07:07 ppalaga

gnu-sed is failing, causing the post processing steps to abort returning an error like:

➜  camel-k git:(mvnd-support) ✗ make generate-crd
go: creating new go.mod: module tmp
CONTROLLER_GEN=/Users/chikki/go/bin/controller-gen ./script/gen_crd.sh
sed: 1: "/creationTimestamp:/a\  ...": extra characters after \ at the end of a command
make: *** [generate-crd] Error 1

SubhasmitaSw avatar Jul 13 '22 08:07 SubhasmitaSw

Hi @SubhasmitaSw do you plan to continue work on this change ?

claudio4j avatar Oct 19 '22 21:10 claudio4j

Yes @claudio4j I'll whack this up in the weekends, sorry for the delay.

SubhasmitaSw avatar Oct 20 '22 05:10 SubhasmitaSw

This PR has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Jan 19 '23 00:01 github-actions[bot]