Skip to content

Commit 82d0ad4

Browse files
cleanup of unnecessary condition
1 parent b34d7e6 commit 82d0ad4

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/generator/GenerationProcessorImpl.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,15 @@ private ClassLoader prependTemplatesClassloader(ClassLoader inputProjectClassLoa
279279
}
280280

281281
if (Files.exists(pomFile)) {
282-
String pomFileHash = MavenUtil.generatePomFileHash(pomFile, MavenUtil.determineMavenRepositoryPath());
283-
284-
if (!this.configurationHolder.isTemplateSetConfiguration()) {
285-
if (this.configurationHolder.isJarConfig()) {
286-
cpCacheFile = configLocation
287-
.resolveSibling(String.format(MavenConstants.CLASSPATH_CACHE_FILE, pomFileHash));
288-
} else {
289-
cpCacheFile = configLocation.resolve(String.format(MavenConstants.CLASSPATH_CACHE_FILE, pomFileHash));
290-
}
291-
} else {
292-
cpCacheFile = configLocation.resolve(String.format(MavenConstants.CLASSPATH_CACHE_FILE, pomFileHash));
282+
String pomFileHash = MavenUtil.generatePomFileHash(pomFile, MavenUtil.determineMavenRepositoryPath());
283+
284+
// gets classpath cache file within template-sets folder
285+
cpCacheFile = configLocation.resolve(String.format(MavenConstants.CLASSPATH_CACHE_FILE, pomFileHash));
286+
287+
// gets classpath cache file from parent directory of configuration location of monolithic template jar
288+
if (!this.configurationHolder.isTemplateSetConfiguration() && this.configurationHolder.isJarConfig()) {
289+
cpCacheFile = configLocation
290+
.resolveSibling(String.format(MavenConstants.CLASSPATH_CACHE_FILE, pomFileHash));
293291
}
294292

295293
combinedClassLoader = MavenUtil.addURLsFromCachedClassPathsFile(cpCacheFile, pomFile, combinedClassLoader);

0 commit comments

Comments
 (0)