diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd1827e5..4113015ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [2023.2.10] ### `Project Import` enhancements +- Register web spring files available due `ext.?.extension.webmodule.webroot` property [#776](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/776) - Do not register SAP javadocs for custom extensions [#763](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/763) - Use custom library names for all custom libraries [#764](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/764) - Ignore non-`[y]` project roots if they will affect project import [#774](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/774) diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSpringConfigurator.kt b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSpringConfigurator.kt index f371a0edd..fb355d775 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSpringConfigurator.kt +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSpringConfigurator.kt @@ -45,6 +45,7 @@ import java.io.IOException import java.util.* import java.util.regex.Pattern import java.util.zip.ZipFile +import kotlin.io.path.exists class DefaultSpringConfigurator : SpringConfigurator { @@ -129,6 +130,20 @@ class DefaultSpringConfigurator : SpringConfigurator { LOG.error("", e) return } + + // specifci case for OCC like extensions, usually, they have web-spring.xml files in the corresponding resources folder + projectProperties.getProperty("ext.${moduleDescriptor.name}.extension.webmodule.webroot") + ?.let { if (it.startsWith("/")) it.removePrefix("/") else it } + ?.let { + getResourceDir(moduleDescriptor).toPath() + .resolve(it) + .resolve(moduleDescriptor.name) + .resolve("web") + .resolve("spring") + } + ?.takeIf { it.exists() } + ?.let { addSpringXmlFile(moduleDescriptorMap, moduleDescriptor, it.toFile(), moduleDescriptor.name + "-web-spring.xml") } + projectProperties.stringPropertyNames() .filter { it.endsWith(HybrisConstants.APPLICATION_CONTEXT_SPRING_FILES)