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
Fix wrong resources directory path #2880
base: master
Are you sure you want to change the base?
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #2880 (2024-04-23T19:07:16Z) ⚙️ JKube E2E Tests (8805703941)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2880 +/- ##
=============================================
+ Coverage 59.36% 70.62% +11.26%
- Complexity 4586 5012 +426
=============================================
Files 500 486 -14
Lines 21211 19453 -1758
Branches 2830 2505 -325
=============================================
+ Hits 12591 13739 +1148
+ Misses 7370 4491 -2879
+ Partials 1250 1223 -27 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com> fix typo of resourcesDirectory javadoc in JavaProject class Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
0c6dd01
to
4f19318
Compare
Let's discuss this on the issue first. |
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
2bd807b
to
57f9e2a
Compare
Quality Gate passedIssues Measures |
@@ -43,6 +44,7 @@ void setUp() { | |||
GeneratorContext generatorContext = GeneratorContext.builder() | |||
.config(processorConfig) | |||
.logger(logger) | |||
.project(new JavaProject(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 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.
Why is this change needed? How is this change verifying the bug this patch is fixing?
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.
Maybe you can directly use JavaProject.builder().build()
?
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 very valuable feedback! I take into account your remarks.
@@ -57,6 +57,7 @@ public List<ImageConfiguration> generate(List<ImageConfiguration> imageConfigs) | |||
if (generator.isApplicable(ret)) { | |||
log.info("Running generator %s", generator.getName()); | |||
ret = generator.customize(ret, genCtx.isPrePackagePhase()); | |||
log.info("The following properties file is used %s", genCtx.getProject().getPropertiesFile()); |
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.
log.info("The following properties file is used %s", genCtx.getProject().getPropertiesFile()); | |
log.info("The following properties file are used %s", genCtx.getProject().getPropertiesFile()); |
|
||
public URL getPropertiesFile() { | ||
return this.propertiesFile; | ||
} |
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're using Lombok, You can directly use @Getter
/@Setter
here.
import java.net.URL; | ||
import java.util.Properties; | ||
|
||
public class PropertiesExtender extends Properties { |
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 sure about the motivation behind using this POJO. Why not use a URL
field directly?
Description
Fixes #2832
This PR brings the bug fix of wrong resources directory path.
URLClassLoader
instance was unable to find out neitherapplication.yml
norapplication.properties
resources files due to wrong URLs paths defined.Method
findResource
searches for resources files among URLs list, however URL wasbaseDir
+/target/classes
, which was given byjKubeProject.getOutputDirectory().getAbsolutePath()
call.I decided to add separate field for resources dir in the
JavaProject
class and add anotherjKubeProject.getResourcesDirectory().getAbsolutePath()
call to get the right resources path, which should bebaseDir
+/src/main/resources
Type of change
test, version modification, documentation, etc.)
Checklist