Skip to content

Commit

Permalink
remove additional path for properties file, add INFO message for prop…
Browse files Browse the repository at this point in the history
…erties file

Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
  • Loading branch information
arsenalzp authored and rohanKanojia committed Sep 3, 2024
1 parent dcf8ee7 commit 5f8bdab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ public class JavaProject implements Serializable {
* @return The base directory for the project.
*/
private File baseDirectory;
/**
* Project's resources directory
*
* @param resourcesDirectory resources directory where project resources look for.
* @return The resources directory for the project.
*/
private File resourcesDirectory;
/**
* Directory where all build files are located (e.g. target)
*
Expand Down Expand Up @@ -308,7 +301,6 @@ public JavaProject(
this.scmTag = scmTag;
this.buildPackageDirectory = buildPackageDirectory;
this.maintainers = maintainers;
this.resourcesDirectory = baseDirectory != null ? new File(baseDirectory.getAbsolutePath() + "/src/main/resources") : new File("src/main/resources");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import lombok.Getter;
import lombok.Setter;

// This class expends Properties class
// with URL of properties file path.
public class PropertiesExtender extends Properties {
@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ public static String createDefaultResourceName(String artifactId, String ... suf
public static URLClassLoader getClassLoader(JavaProject jKubeProject) {
return ClassUtil.createClassLoader(
jKubeProject.getCompileClassPathElements(),
jKubeProject.getOutputDirectory().getAbsolutePath(),
jKubeProject.getResourcesDirectory().getAbsolutePath());
jKubeProject.getOutputDirectory().getAbsolutePath());
}

public static String getProperty(String key, JavaProject project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.net.URL;
import java.util.List;
import java.util.Properties;
import java.util.Set;
Expand Down Expand Up @@ -102,7 +103,12 @@ private List<ImageConfiguration> generateImages(List<ImageConfiguration> imageCo
if (generator.isApplicable(ret)) {
log.info("Running generator %s", generator.getName());
ret = generator.customize(ret, genCtx.isPrePackagePhase());
log.info("The following properties file are used %s", genCtx.getProject().getPropertiesFile());
URL propFileURL = genCtx.getProject().getPropertiesFile();
if (propFileURL != null) {
log.info("The following properties file is used %s", propFileURL);
} else {
log.info("No properties file found");
}
}
}
return ret;
Expand Down

0 comments on commit 5f8bdab

Please sign in to comment.