[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-dev] Query Regarding Maven Aspectj
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Mon, 9 Apr 2012 11:48:41 -0700
- Delivered-to: email@example.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=kGLLal4bp21dyh4jwV3KBy8WNYw0aHhBNtbgzgqgQRw=; b=nn2vuOPY2VfuTc5Z8mwLT8FTOGyszI3EmuN1dd2NknLsz/KDnB354kx3RT3QJmQjy/ jaJ/6KIzq6+q337gaVjLjHtyVWyO4r3fRHDZCGCgxnfSCQ/T+CxVI66m91Jxni+rfIAe B9/S7cADWgDBiHtw4fSRD/HUM3CZEpzUFE2hKvMxM24I0QIyBiRBzpLIn0vAi7xUdPqY KlSn+c+xITrQUYehaJCGiZtmyHssyrdCG5w2z1gcZKFmtA5RwoUJFYTXmrp0Dn7ksl8C SW63TP4qGAUB1jO0ukgkBVDmYyh+rl+LZDlCIV1m3RFYN8MrfXieOZJrxqJeDbUHf0fI 0FNA==
It isn't clear to me when you are wanting the aspects to be woven in?
Are you doing compile time weaving (looks like you might be)? In this
mode you can just run the result with 'java', you don't need to see
Are you doing loadtime weaving? (where the aspects are separate to the
basecode and you want them applied as the application loads). I don't
see the separate builds of basecode and aspects in the pom, but I do
see the javaagent being set for loadtime weaving.
If you are loadtime weaving you will need an aop.xml. Which you can
generate or write yourself, it simply lists the aspects:
and will be looked up through your classpath (weaver expects to find
it in a META-INF subfolder).
Is your app code in app.jar? If so, where are your aspects on the
classpath when you run it? If they are also in app.jar and it was all
woven at compile time, just don't use the agent setting.
But I guess it comes down to my first question - do you want to weave
at compile time or later? You have the choice.
On 9 April 2012 00:23, arun viswanath <arun.viswanath@xxxxxxxxx> wrote:
> Hi Andy,
> Thanks for your quick response.
> I'm pasting my pom contents below.
> <goal>compile</goal> <!-- use this goal to
> weave all your main classes -->
> <goal>test-compile</goal> <!-- use this goal to
> weave all your test classes -->
> Any my application start command is
> nohup java -Xms1024M -Xmx2048M
> -Djava.util.logging.config.file=$PRJ_HOME/conf/log.properties -jar
> -classpath $PRJ_HOME/lib/jars/aspectjrt-1.6.11.jar
> -Dorg.apache.activemq.UseDedicatedTaskRunner=true $PRJ_HOME/lib/jars/app.jar
> >$START_STATUS 2>&1 &
> I'm missing some thing here no able to spot it.
> Your help will be really appreciated.
> On Sat, Apr 7, 2012 at 5:02 AM, Andy Clement <andrew.clement@xxxxxxxxx>
>> Hi Arun,
>> You should just be able to run the code after your build finishes. I
>> presume you were doing a regular build of aspects and java source
>> code, to produce a woven result. You weren't load time weaving?
>> The only requirement for running woven code is that you have the
>> aspectj runtime (aspectjrt.jar) on the classpath when you run java.
>> If you are loadtime weaving then you may need to use the javaagent
>> when you run the code
>> (-javaagent:<pathtoaspectj>/lib/aspectjweaver.jar) but that is only
>> required if the java source and aspects have been compiled separately.
>> Maybe if you show me your pom I can puzzle it out.
>> On 5 April 2012 22:28, arun viswanath <arun.viswanath@xxxxxxxxx> wrote:
>> > Hi,
>> > This is Arun. I’m using AspectJ in my project. My project is based on
>> > Maven.
>> > I’m able to successfully compile the .aj file and when I try to run the
>> > testcase using maven my aspects are working fine.
>> > But when I start executing the program from command prompt (eg.. java
>> > <*.jar>) my aspects are not working. Is it necessary to set any Java JVM
>> > option for my aspect to execute.
>> > Thanks In Advance,
>> > Arun V
>> > _______________________________________________
>> > aspectj-dev mailing list
>> > aspectj-dev@xxxxxxxxxxx
>> > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>> aspectj-dev mailing list
> aspectj-dev mailing list