Saturday, 15 August 2015

spring - Warnings when using aspectj in my Maven project -



spring - Warnings when using aspectj in my Maven project -

i’m trying utilize aspect seaving in maven/spring (3.2.11.release) project. have configured plugin …

<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <configuration> <compliancelevel>1.6</compliancelevel> <aspectlibraries> <aspectlibrary> <groupid>org.springframework</groupid> <artifactid>spring-aspects</artifactid> </aspectlibrary> </aspectlibraries> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin>

and here’s aspects dependencies …

<dependency> <groupid>org.aspectj</groupid> <artifactid>aspectjweaver</artifactid> <version>1.8.2</version> </dependency> <dependency> <groupid>org.aspectj</groupid> <artifactid>aspectjrt</artifactid> <version>1.8.2</version> </dependency>

but when run “mvn clean install” these warnings …

[info] --- aspectj-maven-plugin:1.7:compile (default) @ pd --- [info] showing ajc message detail messages of types: [error, warning, fail] [warning] advice defined in org.springframework.scheduling.aspectj.abstractasyncexecutionaspect has not been applied [xlint:advicedidnotmatch] /users/davea/.m2/repository/org/springframework/spring-aspects/3.2.11.release/spring-aspects-3.2.11.release.jar!org/springframework/scheduling/aspectj/abstractasyncexecutionaspect.class:58 [warning] advice defined in org.springframework.mock.staticmock.annotationdrivenstaticentitymockingcontrol has not been applied [xlint:advicedidnotmatch] /users/davea/dropbox/workspace/pd/org/springframework/mock/staticmock/annotationdrivenstaticentitymockingcontrol.aj:83 [warning] advice defined in org.springframework.mock.staticmock.abstractmethodmockingcontrol has not been applied [xlint:advicedidnotmatch] /users/davea/.m2/repository/org/springframework/spring-aspects/3.2.11.release/spring-aspects-3.2.11.release.jar!org/springframework/mock/staticmock/abstractmethodmockingcontrol.class:190 [warning] advice defined in org.springframework.mock.staticmock.abstractmethodmockingcontrol has not been applied [xlint:advicedidnotmatch] /users/davea/.m2/repository/org/springframework/spring-aspects/3.2.11.release/spring-aspects-3.2.11.release.jar!org/springframework/mock/staticmock/abstractmethodmockingcontrol.class:199

how resolve dependencies these warnings go away?

edit: configuration have set in spring web-inf/dispatcher-servlet.xml file. i'm trying create private method @transactional ...

<bean class="org.springframework.transaction.aspectj.annotationtransactionaspect" factory-method="aspectof"> <property name="transactionmanager" ref="transactionmanager"/> </bean> <tx:annotation-driven mode="aspectj" transaction-manager="transactionmanager" /> <tx:advice id="txadvice" > <tx:attributes> <tx:method name="generateaccess" propagation="required"/> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="orderservicepc" expression="execution(* org.mainco.subco.myproject.service.orderservice.*(..))" /> <aop:advisor advice-ref="txadvice" pointcut-ref="orderservicepc" /> </aop:config>

spring aspectj compile-time-weaving aspectj-maven-plugin

No comments:

Post a Comment