Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling Roo generated AspectJ files in Eclipse

I have generated a sample roo project using command prompt and then imported it to the eclipse.But i found that most of the important files are in aj extension.How can i change these files into java files.I want to do this in eclipse.

like image 679
rakesh menon Avatar asked Dec 05 '22 17:12

rakesh menon


2 Answers

If you want the .aj files to show up in the Project Explorer:

  1. Click on the down arrow on the top right corner of the Project Explorer panel.
  2. Choose Customize View...
  3. In the Filters tab, uncheck Hide generated Spring Roo ITDs

(I found this question searching for how to do this, so I wrote it here)

like image 95
Ena Avatar answered Jan 13 '23 13:01

Ena


First of all, you do not have to convert the .aj files to java. They are Roo generated aspects which does the magic behind Roo.

You should not modify or delete Roo generated .aj files. If you want to override the behavior of them, you should "Push In" refactor the methods to the necessary java files or you can simply create methods with the same method signature in the related java file. Roo will automatically modify the .aj file and remove the overridden method from the .aj file. Remember, you need to have the Roo shell running in order for this to happen or it would happen the next time you start the Roo shell.

To use the "Push In" refactoring feature, you can use AJDT for eclipse, which is often the preferred plugin for AspectJ related development in Eclipse.

Cheers.

like image 43
bhagyas Avatar answered Jan 13 '23 12:01

bhagyas