Ant all VS Ant clean all commands in SAP Commerce [Hybris]

In this article, I will explain the difference between most commonly used Ant build commands like ant all & ant clean all.

SAP Hybris uses Apache Ant build framework to build the extensions or modules in the Hybris framework. 

There are several ant targets available to build the hybris framework like ant all, ant clean and ant clean all.

We can find list of available ant targets by using ant -p command as shown below:

Note: before running any ant command we must set ant environment from platform folder.
          C:\Trainings\CX2211\hybris\bin\platform>setantenv.bat


Ant clean all:
When we run the ant clean all command from the platform folder, it does the following things:
  • First it will check whether all folders like bin, config, data, log, roles, temp folders are available inside hybris folder or not. If the folder structure is not available then it creates else it won't create any folder structure. 
  • It deletes all existing generated models and .class files and then start the build from scratch.
Ant all:
  • ant all assumes the folder structure is already available in hybris folder and it will just perform the build for the changes we made in the files like items.xml and .java.
In general ant all is faster and takes less time than ant clean all. And most of the cases ant all is sufficient to serve the build purpose.

ant clean all can be used when we setup hybris for the first time / sometimes if our changes are not reflecting even after using ant all command / to remove unwanted files from the code base.


Note: In hybris ant all is the default ant target.




Happy Learning!!!😊😊😊



Comments

Popular posts from this blog

Type System in SAP Commerce [Hybris]

Differences between Extension and AddOn in SAP Hybris

items.xml in SAP Commerce [Hybris]