Hi Kalle,

What we need is to build 2 different artifacts, a JAR and a WAR file from
the same source folder. 
The problem is that these artifacts are to be weaved with 2 different set of
Aspects. 

Currently we have 2 profiles for building these artifacts which apply the
Aspects on each as needed. 

But we would like to build these artifacts in a single maven execution.

Thanks.
Vishal


kaosko wrote:
> 
> Do you mean that you want to weave in compiled aspects to two
> different modules? If so, that's certainly possible. You are not using
> aspect terminology which makes it a bit difficult to understand what
> you actually want to achieve. But assuming I understood you correctly,
> you'd be using post-compile weaving and you could achieve this by
> configuring something like:
> 
>                               <configuration>
>                                       <source>1.6</source>
>                                       <target>1.6</target>
>                                       <showWeaveInfo>true</showWeaveInfo>
>                                       <aspectLibraries>
>                                               <aspectLibrary>
>                                                       
> <groupId>com.mycompany</groupId>
>                                                       
> <artifactId>myaspectlib</artifactId>
>                                               </aspectLibrary>
>                                       </aspectLibraries>
>                                       <weaveDependencies>
>                                               <weaveDependency>
>                                                       
> <groupId>com.mycompany</groupId>
>                                                       
> <artifactId>applyaspectstothislib</artifactId>
>                                               </weaveDependency>
>                                       </weaveDependencies>
>                               </configuration>
> 
> See http://mojo.codehaus.org/aspectj-maven-plugin/weaveJars.html. You
> also have the option of doing load-time weaving (see
> http://www.eclipse.org/aspectj/doc/released/devguide/ltw.html). Either
> way, if your IDE is Eclipse, it offers decent support for AOP
> (unsurprisingly since aspectj is their project). You would need to
> refactor the aspects to a separate module then configure the aspect
> compiler for the two target modules and make sure that the weaved-in
> classes are packaged up properly (assuming you use compile-time
> weaving).
> 
> Kalle
> 
> 
> On Tue, Jan 12, 2010 at 2:47 PM, Wendy Smoak <[email protected]> wrote:
>> A project team has a set of classes that need to be instrumented two
>> different ways with AspectJ, one to work within a webapp and the
>> second to work standalone.
>>
>> The classes are kept inside the webapp module, so processing them
>> during the build to produce the war works okay.
>>
>> What's the best way to instrument these same classes the _other_ way
>> for the standalone jar?
>>
>> I've suggested establishing separate modules for the 'different' jars
>> and possibly putting the shared code in a third module, but they say
>> it's not possible, and I don't have enough experience with AspectJ to
>> argue the point.  I agree it would probably complicate building in the
>> IDE.
>>
>> At the moment they're doing it with profiles, and executing Maven
>> twice to produce the different artifacts.
>>
>> Any suggestions?
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Maven-and-AspectJ-tp4295057p4394544.html
Sent from the maven users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to