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
fixing #issue872 #1625
fixing #issue872 #1625
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1625 +/- ##
============================================
+ Coverage 34.8% 35.24% +0.44%
- Complexity 1121 1123 +2
============================================
Files 186 186
Lines 10314 10188 -126
Branches 1680 1656 -24
============================================
+ Hits 3590 3591 +1
+ Misses 6302 6174 -128
- Partials 422 423 +1 |
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.
Changelog entry missing as well.
enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/DefaultServiceEnricher.java
Outdated
Show resolved
Hide resolved
enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/DefaultServiceEnricher.java
Outdated
Show resolved
Hide resolved
enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/DefaultServiceEnricher.java
Outdated
Show resolved
Hide resolved
enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/DefaultServiceEnricher.java
Outdated
Show resolved
Hide resolved
enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/DefaultServiceEnricher.java
Show resolved
Hide resolved
try { | ||
if (getContext().getProjectClassLoaders().isClassInCompileClasspath(true)) { | ||
Properties properties = SpringBootUtil.getSpringBootApplicationProperties(getContext().getProjectClassLoaders().getCompileClassLoader()); | ||
return properties.getProperty("spring.application.name"); |
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.
@ro14nd @lordofthejars @rohanKanojia can you provide other property names that we should consider for the name ?
- spring.app.name
- app.name
- spring.service.name ?
WDYT ?
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.
we should stick to standard spring properties, which is spring.application.name
in this case. If there are other ways there, then we can add them here as well.
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.
yeah, that's what I meant..
I think spring.app.name
should be considered as well
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.
@theexplorist can you add a getProperty("spring.app.name")
as well? Even in #872 its mentioned spring.app.name
.
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.
lgtm
@dev-gaur : Can you please take a look if there is anything pending from your side? Otherwise, can we proceed to merge this PR? |
I will update the PR with requested changes by today so it can be good to merge. |
updated changes
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.
Did you verify the change working @theexplorist ?
try { | ||
if (getContext().getProjectClassLoaders().isClassInCompileClasspath(true)) { | ||
Properties properties = SpringBootUtil.getSpringBootApplicationProperties(getContext().getProjectClassLoaders().getCompileClassLoader()); | ||
return properties.getProperty("spring.application.name"); |
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.
@theexplorist can you add a getProperty("spring.app.name")
as well? Even in #872 its mentioned spring.app.name
.
} | ||
|
||
private String getServiceName() { | ||
if (getAppName() != null) { |
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.
Can you skip calling getAppName
twice? Do something like:
String appName = getAppName();
if (appName!=null) {
return appName;
} else {
....
}
After that, I think we are ready to merge.
fixes #872