-
Notifications
You must be signed in to change notification settings - Fork 352
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
Inspect all transitive dependencies of an integration #1777
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added some notes
@lburgazzoli I think I have addressed all the comments. Please let me know what you think. I've made some changes to where the functions that compute the integration dependencies and their sanitization are defined. Let me know if you agree with the move. |
pkg/cmd/inspect.go
Outdated
Long: `Output dependencies for a list of integration files. By default this command returns the | ||
top level dependencies only. When --all-dependencies is enabled, the transitive dependencies | ||
will be generated by calling Maven and then copied into the directory pointed to by the | ||
--dependencies-directory flag.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very sure about this. Would be useful to just get the list of dependencies without having to copy them on a folder ?
@nicolaferraro what do you think ?
@lburgazzoli I have modified the patch to only print transitive dependencies. Please let me know if you have any further comments. |
pkg/util/defaults/defaults.go
Outdated
@@ -42,4 +42,7 @@ const ( | |||
|
|||
// ImageName -- | |||
ImageName = "docker.io/apache/camel-k" | |||
|
|||
// CamelVersion -- | |||
CamelVersion = "3.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a readonly file, which is generated from Makefile options. We've removed the need to specify the Camel version, because a runtime version implies only one Camel version and one Quarkus version.
Instead of hardcoding it here, you can load the CamelCatalog for the current runtime version (it's embedded in the /deploy
virtual file system) and retrieve it from the metadata section (
camel.version: 3.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for the feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool @doru1004 .
The only thing strange I see is that the output looks like:
[nferraro@localhost camel-k]$ kamel inspect examples/simple.groovy --all-dependencies --output=yaml
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< org.apache.camel.k.integration:camel-k-integration >---------
[INFO] Building camel-k-integration 1.3.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- camel-k-maven-plugin:1.5.0:generate-dependency-list (default-cli) @ camel-k-integration ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.856 s
[INFO] Finished at: 2020-11-05T15:24:46+01:00
[INFO] ------------------------------------------------------------------------
dependencies:
- /home/nferraro/.m2/repository/org/apache/camel/k/camel-k-loader-groovy/1.5.0/camel-k-loader-groovy-1.5.0.jar
- /home/nferraro/.m2/repository/org/apache/camel/k/camel-k-runtime-core/1.5.0/camel-k-runtime-core-1.5.0.jar
I.e. the maven part should be probably removed from the output. Wdyt?
Or at least shown only when there's an error |
The maven needs to be run to fetch the dependencies. I'm guessing your concern is regarding whether the output of that command is shown or not. Is that correct? |
Yes, it's only about the output. I imagine that external tools that are going to process the output of that command may get confused. |
After changing to use quarkus I'm getting this type errors when inspecting a simple integration:
Any thoughts? |
I think you need to add the quarkus bom as it's done in the builder |
@nicolaferraro I resolved the error. The change involves moving to running with Quarkus specific project building and dependency resolution routines. |
@nicolaferraro I briefly had another error where a warning would be printed when running the maven command. It turned out to be an error on my side as I was using the wrong runtime dependency. Can confirm that no other output than the list of dependencies is being printed. |
Release Note
This patch adds more functionality to the
kamel inspect
subcommand. The default behavior of this command consists of outputting the top level dependencies. In this patch we enable the saving of the transitive dependencies for an integration in a specific location on the file system local to where thekamel inspect
command was invoked. The transitive dependencies consists of all the jar files required for successfully running the integration.