Huong Dan Java Logger – Part 2 – Change Logger name and package name

After creating the new Anypoint Connector Project, the first two things we want to do immediately are to change the base package name(currently the base package name is too long: com.huongdanjava.huongdanjavaloggercomponent 🙂 ) and change the name of Huong Dan Java Logger from HuongDanJavaLoggerComponent to “Huong Dan Java Logger”.

To change the package name, right-click the package name, select Refactor, and then select Rename. I will rename the package to com.huongdanjava.hdjlogger (remember to choose Rename subpackages):

Huong Dan Java Logger - Part 2 - Change Logger name and package name

Result:

Huong Dan Java Logger - Part 2 - Change Logger name and package name

Next, to rename the Logger component from HuongDanJavaLoggerComponent to Huong Dan Java Logger, let open the HuongDanJavaLoggerComponentConnector class, and change the value of the friendlyName attribute in the @Connect annotation to “Huong Dan Java Logger”. The contents of the HuongDanJavaLoggerComponentConnector class will now look like this:

Now, if you install this Logger component into Anypoint Studio by right-clicking on the project, selecting Anypoint Connector and then selecting Install or Update, you will see in the Mule Palette, our Logger component:

Huong Dan Java Logger - Part 2 - Change Logger name and package name

Add Comment