-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for getting / injecting shared Maven components in JibMavenPluginExtension #3062
Conversation
injection of extensions
injection of extensions - test
This comment has been minimized.
This comment has been minimized.
@googlebot I signed it! |
Codecov Report
@@ Coverage Diff @@
## master #3062 +/- ##
============================================
+ Coverage 71.09% 71.12% +0.03%
- Complexity 2307 2315 +8
============================================
Files 278 278
Lines 9755 9790 +35
Branches 989 991 +2
============================================
+ Hits 6935 6963 +28
- Misses 2480 2482 +2
- Partials 340 345 +5 Continue to review full report at Codecov.
|
configuration ... but just another extensionLoader mechanism
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 "Maven & JSR-330" stuff (Sisu?) looks like magic.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java
Outdated
Show resolved
Hide resolved
...ugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesExtensionTest.java
Outdated
Show resolved
Hide resolved
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java
Show resolved
Hide resolved
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java
Outdated
Show resolved
Hide resolved
@stefanocke question: I see the change is to inject Jib extensions, not that it's to inject a Maven component in an Jib extension. Just in case, I wonder if Sisu can't just inject Maven components for Jib extensions loaded by the JDK server loader? (If that's indeed the case, we wouldn't need this change?) |
@chanseokoh , the short answer is: no. The longer answer:
Or do you mean the extension could do the dependency injection by itself, for exampe in its constructor? So to summarize: I am convinced the approach I have choosen is the right one. It is compliant to the only existing Maven documentation regarding Sisu / DI. And I even believe, there is no other working approach at all. To explain it from a different angle: It is not the case that we use Sisu just for our extension.
|
Yeah, I expected this. Didn't really thought Sisu can inject things into an instance created by the service loader. Was wondering just in case. I think this approach looks good, and perhaps this is what we can recommend going forward. |
This reverts commit 279418c.
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.
Thank you for your contribution!
Thanks again for this cool feature! |
Pull request for #3036.