Reputation: 163
I am working on a internal app in Hybris
. Like HMC
. I have create an extension and added the required extensions in the extensioninfo.xml
, but when I am trying to import a bean
in those required extensions, I am seeing class cannot be resolved
. I have cleaned the project. But I am unable to resolve this issue. Can someone guide me. I can provide more details on request.
<extensioninfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extensioninfo.xsd">
<extension abstractclassprefix="Generated" classprefix="Sma" managername="SmaManager" managersuperclass="de.hybris.platform.jalo.extension.Extension" name="sma" usemaven="false">
<!-- for more information on maven managed libraries please consult https://wiki.hybris.com/x/Nq8sDQ -->
<!-- you should add all required extensions to this list, except platform extensions which are automatically required -->
<!-- <requires-extension name="cms"/> -->
<requires-extension name="services"/>
<coremodule generated="true" manager="com.company.sma.jalo.SmaManager" packageroot="com.company.sma"/>
<webmodule jspcompile="false" webroot="/sma"/>
</extension>
</extensioninfo>
Upvotes: 3
Views: 4677
Reputation: 5810
[yjavac] 1. ERROR cannot be resolved to a type in Hybris?
Extensions can have dependencies on one another. The build only works if the required extension is available.
Ensure the below steps to works it smoothly.
/platform/ext
) Extensionlocalextensions.xml
extensioninfo.xml
(e.g <requires-extension name="hmc"/>
) of the dependent extensionIn your eclipse(IDE), add required extension in build path
of the dependent extension to resolve IDE dependecy.
Note: Adding required extension in IDE build path won't resolve extension dependency of your platform. It only resolved by extensioninfo.xml
Rebuild the system (ant clean all
)
By default, all extensions have the dependency on Platform extension(located at /platform/ext
). Therefore, you do not required to specify requires-extension
for the Platform extensions in extensioninfo.xml
file.
Upvotes: 0
Reputation: 1748
In the extensioninfo.xml
file, we add only the extension dependencies. So, when you add a new Hybris extension, you need to add it to your localextensions.xml
file, required extensions too. Don't miss that :
All extensions located in ${HYBRIS_BIN_DIR}/platform/ext are automatically loaded, no need to add them to localextensions.xml file.
Then, ant clean all
will build your extensions ressources.
If you cannot resolve your extentions in the IDE, you need to add them to the build path
manually.
Upvotes: 7