maven examples please

View: New views
5 Messages — Rating Filter:   Alert me  

maven examples please

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a third party jar that I want to instrument using AOP and want to
have two maven projects:

1) compiles all the aspect code into a standalone jar
2) weaves the aspects into the third party jar

Could someone please provide some simple pom examples for both?

thx

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: maven examples please

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Captain Haddock wrote:
> I have a third party jar that I want to instrument using AOP and want to
> have two maven projects:
>
> 1) compiles all the aspect code into a standalone jar
> 2) weaves the aspects into the third party jar
>
> Could someone please provide some simple pom examples for both?
>
> thx

fyi I have one aspect in src/main/aspectj

there are no tests

am using maven 2.1.0

thx

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: Re: maven examples please

by Ramnivas Laddad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here is a zip files from the upcoming AspectJ in Action, 2nd edition
(sorry for the inevitable plug) that contains four projects to show
various options with Maven.

As for the aspects in src/main/aspectj, I believe you can indicate to
Maven that it should be considered as the source directory.

-Ramnivas

On Thu, Jun 11, 2009 at 8:04 PM, Captain Haddock<davidg@...> wrote:

> Captain Haddock wrote:
>>
>> I have a third party jar that I want to instrument using AOP and want to
>> have two maven projects:
>>
>> 1) compiles all the aspect code into a standalone jar
>> 2) weaves the aspects into the third party jar
>>
>> Could someone please provide some simple pom examples for both?
>>
>> thx
>
> fyi I have one aspect in src/main/aspectj
>
> there are no tests
>
> am using maven 2.1.0
>
> thx
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@...
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

appendixB.zip (15K) Download Attachment

Re: maven examples please

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok so I was on the right lines .. however I am using annotations and my
compile fails as shown below:

...
[INFO] [aspectj:compile {execution: default}]
[ERROR] Syntax error, annotations are only available if source level is 5.0
[ERROR] Syntax error, annotations are only available if source level is 5.0
[ERROR] Syntax error, annotations are only available if source level is 5.0
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Compiler errors :
error at @Aspect
^^^^^^
C:\aop-aspects\src\main\java\aspects\AppAspect.aj:27:0::0 Syntax error,
annotations are only available if source level is 5.0
error at @Pointcut("initialization(foo.App.new(..))")
^^^^
C:\aop-aspects\src\main\java\aspects\AppAspect.aj:30:0::0 Syntax error,
annotations are only available if source level is 5.0
error at @AfterReturning("appConstructor()")
^^^^^^^^^^
C:\aop-aspects\src\main\java\aspects\AppAspect.aj:33:0::0 Syntax error,
annotations are only available if source level is 5.0
...

I have tried directing the compiler with the following:

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>2.0.2</version>
         <configuration>
           <source>1.5</source>
           <target>1.5</target>
         </configuration>
       </plugin>

but still get the failure


Ramnivas Laddad wrote:

> Here is a zip files from the upcoming AspectJ in Action, 2nd edition
> (sorry for the inevitable plug) that contains four projects to show
> various options with Maven.
>
> As for the aspects in src/main/aspectj, I believe you can indicate to
> Maven that it should be considered as the source directory.
>
> -Ramnivas
>
> On Thu, Jun 11, 2009 at 8:04 PM, Captain Haddock<davidg@...> wrote:
>> Captain Haddock wrote:
>>> I have a third party jar that I want to instrument using AOP and want to
>>> have two maven projects:
>>>
>>> 1) compiles all the aspect code into a standalone jar
>>> 2) weaves the aspects into the third party jar
>>>
>>> Could someone please provide some simple pom examples for both?
>>>
>>> thx
>> fyi I have one aspect in src/main/aspectj
>>
>> there are no tests
>>
>> am using maven 2.1.0
>>
>> thx
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@...
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@...
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: maven examples please

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Found answer at:
http://toolslab.com/content/fixing-java-15-source-problems-with-aspectj-maven-plugin-154

Captain Haddock wrote:

> ok so I was on the right lines .. however I am using annotations and my
> compile fails as shown below:
>
> ...
> [INFO] [aspectj:compile {execution: default}]
> [ERROR] Syntax error, annotations are only available if source level is 5.0
> [ERROR] Syntax error, annotations are only available if source level is 5.0
> [ERROR] Syntax error, annotations are only available if source level is 5.0
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compiler errors :
> error at @Aspect
> ^^^^^^
> C:\aop-aspects\src\main\java\aspects\AppAspect.aj:27:0::0 Syntax error,
> annotations are only available if source level is 5.0
> error at @Pointcut("initialization(foo.App.new(..))")
> ^^^^
> C:\aop-aspects\src\main\java\aspects\AppAspect.aj:30:0::0 Syntax error,
> annotations are only available if source level is 5.0
> error at @AfterReturning("appConstructor()")
> ^^^^^^^^^^
> C:\aop-aspects\src\main\java\aspects\AppAspect.aj:33:0::0 Syntax error,
> annotations are only available if source level is 5.0
> ...
>
> I have tried directing the compiler with the following:
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <version>2.0.2</version>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>
> but still get the failure
>
>

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users