Converted AJ project differs from native AJ project [message #986615] |
Wed, 21 November 2012 08:21 |
Erik Vande Velde Messages: 82 Registered: September 2012 |
Member |
|
|
I'm trying to convert the very simple hello world example (eclipse menu Help->Cheat Sheets...) to a project that's organized in a maven way, with three different modules: domain, core and testframework. Purpose: find out if the aspect target (in domain), aspect code (in core) and aspect target invoker (testcase in testframework) can be located in different modules, and how to configure this. The first problem I see is: when I convert a regular project (core) to an AspectJ project, the World.aj file is displayed with a different icon then the original World.aj in the CheatSheet project, and what's worse: the AspectJ Visualisation perspective doesn't recognize this aspect, it doesn't want to show it. Don't know if it's relevant: I'm using eclipse juno J2EE version for this. A screenshot, showing the different icons, is attached ...
|
|
|
|
|
|
|
|
Re: Converted AJ project differs from native AJ project [message #987347 is a reply to message #987128] |
Mon, 26 November 2012 09:03 |
Erik Vande Velde Messages: 82 Registered: September 2012 |
Member |
|
|
This means that non-core contains at least one regular class and at least one aspect. To work together with the Aspectj visualizer in eclipse the aspect needs to be in src/main/aspectj, the regular class belongs in src/main/java. But maven can only handle one source directory, so I'm stuck once again. I tried to put both the aspect and the class under src/main/aspectj, and use that folder as the single maven source folder, but in that case the aspect is not rendered with the familiar aspectj-icon in eclipse when I convert the project in a aspectj project. The only thing that works for me today is: put the classes under src/main/java, and aspects under src/main/aspectj. A maven clean install just compiles, ignoring the aspects. Then I import the projects in eclipse (after a maven eclipse:eclipse on the command line), convert them to aspectj projects, add the src/main/aspectj directories as source folders, and everything works in eclipse. But of course this won't work from the command line, because only eclipse can see these aspectj folders, maven is not interested in them. I attached my code to this message. A simple challenge for you Andrew, or some other aspectj wizard of course: make this very simple code compile and run (applying the aspect) from maven and eclipse. In eclipse it should show how the aspect is applied in the visualizer. I'm afraid I still can't do it, but I would love it if someone else can ...
[Updated on: Mon, 26 November 2012 09:05] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05045 seconds