Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » cross-project aspects?
cross-project aspects? [message #62304] Tue, 28 February 2006 07:30 Go to next message
Eclipse UserFriend
Originally posted by: yoduderoo.netscape.net

Hi,
Should it be possible to define an Aspect in one project which weaves
into code from another?

For example, I create an AspectJ project A. I convert an existing Java
project, B, by right-clicking the Java project and performing relevant
action. I create an aspect, TestAspect, in project A which defines a
pointcut on a Java source in B. It compiles, but there are no markers.
If I move the source from B into aspect project A, the markers appear.

Can I have a separate project with my aspects which weave into other
projects?

Versions:
AJDT 1.2.1, Build 20051220151004, AspectJ version: 1.5.0
IBM RSA 6.0 (Eclipse 3.0)
JRE 1.4.2

Thanks, y
Re: cross-project aspects? [message #62328 is a reply to message #62304] Tue, 28 February 2006 10:26 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Yes, it's possible.
If you make project B an AspectJ project (you don't have to have any
aspects in it!), you can add project A to the "aspect path" of
project B (under the project's properties pages). The weaving will then
take place in project A. Alternatively, if you want to keep project B as a
Java project, you could do the weaving in project A, by setting the
"in path" to be the output folder of project B.

Hope that helps,

Matt.

On Tue, 28 Feb 2006 08:30:52 +0100, Yodude wrote:

> Hi,
> Should it be possible to define an Aspect in one project which weaves
> into code from another?
>
> For example, I create an AspectJ project A. I convert an existing Java
> project, B, by right-clicking the Java project and performing relevant
> action. I create an aspect, TestAspect, in project A which defines a
> pointcut on a Java source in B. It compiles, but there are no markers.
> If I move the source from B into aspect project A, the markers appear.
>
> Can I have a separate project with my aspects which weave into other
> projects?
>
> Versions:
> AJDT 1.2.1, Build 20051220151004, AspectJ version: 1.5.0
> IBM RSA 6.0 (Eclipse 3.0)
> JRE 1.4.2
>
> Thanks, y
Re: cross-project aspects? [message #62761 is a reply to message #62328] Wed, 15 March 2006 15:21 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:pan.2006.02.28.10.26.57.753030@gmail.com...
>
> If you make project B an AspectJ project (you don't have to have any
> aspects in it!), you can add project A to the "aspect path" of
> project B (under the project's properties pages). The weaving will then
> take place in project A.

How do I add project A to the "aspect path" of project B? I see that I
can add JARs, External JARs, Variables and Class Folders, but I don't see a
way to add projects.

- Oliver
Re: cross-project aspects? [message #62782 is a reply to message #62761] Wed, 15 March 2006 15:41 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
On Wed, 15 Mar 2006 10:21:15 -0500, Oliver Wong wrote:
> How do I add project A to the "aspect path" of project B? I see that I
> can add JARs, External JARs, Variables and Class Folders, but I don't see a
> way to add projects.

Use the Class Folder option and add the output folder (usually the "bin"
directory) of the other project.

Maybe we should add an explicit control to add projects - it would make it
a bit clearer.

Regards,

Matt.
Re: cross-project aspects? [message #592376 is a reply to message #62304] Tue, 28 February 2006 10:26 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Yes, it's possible.
If you make project B an AspectJ project (you don't have to have any
aspects in it!), you can add project A to the "aspect path" of
project B (under the project's properties pages). The weaving will then
take place in project A. Alternatively, if you want to keep project B as a
Java project, you could do the weaving in project A, by setting the
"in path" to be the output folder of project B.

Hope that helps,

Matt.

On Tue, 28 Feb 2006 08:30:52 +0100, Yodude wrote:

> Hi,
> Should it be possible to define an Aspect in one project which weaves
> into code from another?
>
> For example, I create an AspectJ project A. I convert an existing Java
> project, B, by right-clicking the Java project and performing relevant
> action. I create an aspect, TestAspect, in project A which defines a
> pointcut on a Java source in B. It compiles, but there are no markers.
> If I move the source from B into aspect project A, the markers appear.
>
> Can I have a separate project with my aspects which weave into other
> projects?
>
> Versions:
> AJDT 1.2.1, Build 20051220151004, AspectJ version: 1.5.0
> IBM RSA 6.0 (Eclipse 3.0)
> JRE 1.4.2
>
> Thanks, y
Re: cross-project aspects? [message #592554 is a reply to message #62328] Wed, 15 March 2006 15:21 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:pan.2006.02.28.10.26.57.753030@gmail.com...
>
> If you make project B an AspectJ project (you don't have to have any
> aspects in it!), you can add project A to the "aspect path" of
> project B (under the project's properties pages). The weaving will then
> take place in project A.

How do I add project A to the "aspect path" of project B? I see that I
can add JARs, External JARs, Variables and Class Folders, but I don't see a
way to add projects.

- Oliver
Re: cross-project aspects? [message #592563 is a reply to message #62761] Wed, 15 March 2006 15:41 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
On Wed, 15 Mar 2006 10:21:15 -0500, Oliver Wong wrote:
> How do I add project A to the "aspect path" of project B? I see that I
> can add JARs, External JARs, Variables and Class Folders, but I don't see a
> way to add projects.

Use the Class Folder option and add the output folder (usually the "bin"
directory) of the other project.

Maybe we should add an explicit control to add projects - it would make it
a bit clearer.

Regards,

Matt.
Re: cross-project aspects? [message #1738890 is a reply to message #62761] Mon, 25 July 2016 17:36 Go to previous messageGo to next message
Alex Kashko is currently offline Alex KashkoFriend
Messages: 2
Registered: July 2009
Junior Member
I have spent all day trying ways to keep my aspects in one project, but used in another without success. Including the solution given here.

I want the aspects in one project to be used in a dynamic web project.

I am using Eclipse J2ee Neon and the latest AJDT tools (45) on OSX Yosemite.

I can use the aspect and I can use the dynamic web project. Each works separately but the aspect is not entered when I try to use them together.

I attach zip files of both projects
Re: cross-project aspects? [message #1739474 is a reply to message #1738890] Tue, 02 August 2016 09:02 Go to previous message
Alex Kashko is currently offline Alex KashkoFriend
Messages: 2
Registered: July 2009
Junior Member
Update: With a vanilla standalone project I can put aspects in one project and access them from another

It seems impossible to do this if, as in my case, the project using the aspect is a RESTful webservice.

I find this hard to understand since once on a server the webservoce is just another application

I can use an aspect that resides inside the webservice but not outside.


Previous Topic:Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.javaeditor.Compilati
Next Topic:news.eclipse.org is shutting down.
Goto Forum:
  


Current Time: Fri Mar 29 05:03:19 GMT 2024

Powered by FUDForum. Page generated in 0.02631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top