You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Keith F Irwin <ke...@keithirwin.com> on 2004/01/20 00:18:51 UTC

AspectJ and Web Archives (was RE: AspectJ Plugin)

Vince--

I notice in the plugin.jelly notes of the CVS version of the aspectj
plugin that what you've got really doesn't work for WAR files since the
war process does not call jar:jar.

Alas, but pretty much all my work in Java ends up in a war file.

You mention being able to weave into classes, which, as far as I know,
won't work with the ajc compiler.

One way we could do this would be to re-do the war goal (or war:webapp)
to include all app code in a jar file in WEB-INF/lib rather than just
the straight WEB-INF/classes directory.

Another might be to jar the app classes (after war:webapp), weave
aspects into a temp jar, then "unjar" the result back into the
war:webapp target directories (overwriting as necessary), then call
war:war to re-package it all up.

What do you think?

Seems to me that aspects are especially useful in a web context, where
practically everything has crosscutting concerns, and its sad that maven
and the aspect compiler hasn't gotten it figured out yet!

Weaving from jars to jars (or classes to classes) seems the only sane
way to deal with the fact that ajc requires recompilation of all the
classes on each change.  Ugh! ;)

Keith

On Mon, 2004-01-19 at 12:04, Keith F Irwin wrote:
> On Mon, 2004-01-19 at 11:49, Vincent Massol wrote:
> > > -----Original Message-----
> > > From: Keith F Irwin [mailto:keith@keithirwin.com]
> > > Sent: 19 January 2004 19:40
> > > To: Maven Users List
> > > Subject: AspectJ Plugin
> > > 
> > > Folks--
> > > 
> > > How mature is the AspectJ plugin?  Is it (basically) ready for use,
> > even
> > > if the goals/props aren't yet documented on its site?
> > 
> > Hmmm... Depends on the version you wish to use. There is a 1.1 version
> > which is stable. The latest version in CVS HEAD has not been fully
> > tested. It needs more testers :-)
> 
> I have *such* luck getting stuff out of CVS . . . ;)  Well, it's MLK and
> a holiday from work and my truck is in the shop, so I'll see if I can
> get the "existing" plugin to work (so that I have a sample project),
> then try my hand at what's in CVS.
> 
> (Part of the prob here is learning all the interactions with the
> plugins, the repository, etc, etc.)
> 
> Keith
> 
> > Thanks
> > -Vincent
> > 
> > > 
> > > Curious.
> > > 
> > > Keith
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: AspectJ and Web Archives (was RE: AspectJ Plugin)

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Keith F Irwin [mailto:keith@keithirwin.com]
> Sent: 20 January 2004 00:19
> To: 'Maven Users List'
> Subject: AspectJ and Web Archives (was RE: AspectJ Plugin)
> 
> Vince--
> 
> I notice in the plugin.jelly notes of the CVS version of the aspectj
> plugin that what you've got really doesn't work for WAR files since
the
> war process does not call jar:jar.
> 
> Alas, but pretty much all my work in Java ends up in a war file.
> 
> You mention being able to weave into classes, which, as far as I know,
> won't work with the ajc compiler.
> 
> One way we could do this would be to re-do the war goal (or
war:webapp)
> to include all app code in a jar file in WEB-INF/lib rather than just
> the straight WEB-INF/classes directory.
> 
> Another might be to jar the app classes (after war:webapp), weave
> aspects into a temp jar, then "unjar" the result back into the
> war:webapp target directories (overwriting as necessary), then call
> war:war to re-package it all up.
> 
> What do you think?

I think this all sounds too complex. I suggest to wait until AspetJ's
iajc supports weaving directories. I think to remember that was one of
their direction, but I haven't checked if the AspectJ team has made
progress.

If you wish to help, I'd suggest sending an email to the AspectJ mailing
list and checking on this status. Then if it's not there yet and won't
be in a while, we can restore the previous aspectj plugin and put the
new stuff on a branch, while waiting for the new aspectj version.

What do you think?

Thanks
-Vincent

> 
> Seems to me that aspects are especially useful in a web context, where
> practically everything has crosscutting concerns, and its sad that
maven
> and the aspect compiler hasn't gotten it figured out yet!
> 
> Weaving from jars to jars (or classes to classes) seems the only sane
> way to deal with the fact that ajc requires recompilation of all the
> classes on each change.  Ugh! ;)
> 
> Keith
> 
> On Mon, 2004-01-19 at 12:04, Keith F Irwin wrote:
> > On Mon, 2004-01-19 at 11:49, Vincent Massol wrote:
> > > > -----Original Message-----
> > > > From: Keith F Irwin [mailto:keith@keithirwin.com]
> > > > Sent: 19 January 2004 19:40
> > > > To: Maven Users List
> > > > Subject: AspectJ Plugin
> > > >
> > > > Folks--
> > > >
> > > > How mature is the AspectJ plugin?  Is it (basically) ready for
use,
> > > even
> > > > if the goals/props aren't yet documented on its site?
> > >
> > > Hmmm... Depends on the version you wish to use. There is a 1.1
version
> > > which is stable. The latest version in CVS HEAD has not been fully
> > > tested. It needs more testers :-)
> >
> > I have *such* luck getting stuff out of CVS . . . ;)  Well, it's MLK
and
> > a holiday from work and my truck is in the shop, so I'll see if I
can
> > get the "existing" plugin to work (so that I have a sample project),
> > then try my hand at what's in CVS.
> >
> > (Part of the prob here is learning all the interactions with the
> > plugins, the repository, etc, etc.)
> >
> > Keith
> >
> > > Thanks
> > > -Vincent
> > >
> > > >
> > > > Curious.
> > > >
> > > > Keith
> > > >
> > > >
> > > >
--------------------------------------------------------------------
> -
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org