Add Maven Plugin for Aspect

Reading time ~1 minute

Trying to add spring aop to my S2SH practice project. Somehow, my advice can’t be called at all, though my configuration is totally correct.

After some googling finally find out need to add aspect plugin for maven and dependency.

Dependency:

    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>1.8.7</version>
    </dependency>

Plugin:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <goals>
              <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 -->
            </goals>
          </execution>
        </executions>
      </plugin>

Reference: codehaus-mojo document

comments powered by Disqus

覆巢之下(1)

## AWS与全球最大的同性交友网站### 什么是云? 熟悉科技行业的人,往往都不可避免的了解过**AWS(Amazon Web Service)**,AKA,亚马逊云服务。对于没有技术背景的人,也许比较难以理解这个所谓的玄而又玄的“云服务”到底是怎么个玩意儿?接下来我会...… Continue reading

尚未锦衣,何以还乡

Published on December 15, 2019

AI未来读后感

Published on August 09, 2019