Hybris is collection of several extensions. Extensions is address to specific functionality.
An extension is unit of functionality in hybris. It is an encapsulated piece of the hybris Commerce Suite that can contain business logic, type definitions, configuration etc. Extensions are independent of one another by default.
A basic extension contains the following directories and files:
you can write a custom extension as per your requirement that use or override existing extensions functionalities. You can create your own extension So every extension in hybris contains
Hybris provides an ant-based extension generator and provide extension templates for specific function. you can choose any one as per your requirement.
Extension generation Command :
ant extgen
Hybris provide following extension templates
localextensions.xml
file.After that , you can start write to your business logic in extension.
for example: C:\HYBRIS-1808\hybris\bin\platform
3. type ant extgen command. This will ask you for template
4. The Ant script will create a structure of extension.
<extension name="myfirstextension"/>
5. Run ant all on cmd
C:\HYBRIS-1808\hybris\bin\platform> ant clean all
6. Start the hybris server hybrisserver.bat
C:\HYBRIS-1808\hybris\bin\platform> hybrisserver.bat
7. Open HAC (hybris administration console) http://localhost:9001/hac
Default Login credential
8. For checking Installed Extensions, Go to platform->Extensions or http://localhost:9001/platform/extensions
9. search your extension "myfirstextension" and you will get your extension and webroot will be available for myfirstextension
10. if we do not need a web module for this basic extension, we can disable this in
myfirstextension/extensioninfo.xml
Comment <!--<webmodule jspcompile="false" webroot= "/myfirstextension"/> -->
11. Stop server (ctrl+c) and press y Run ant all and start server
12. Go to browser http://localhost:9001/hac and login again and Go to platform- >Extensions and check webroot for myfirstextension. it will be empty
13. Import the generated extension into your Eclipse and start work on new extension.