2

ロード時の織り方をコンパイル時の織り方に変換しようとしています。

そこで<context:load-time-weaver/>、spring configから削除し、aspectjコンパイラーをに追加しましたpom.xml。しかし、の情報を変換する方法がわかりませんMETA-INF/aop.xml

私はそこにこのようなものを持っています:

<!DOCTYPE aspectj PUBLIC
        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <weaver>
        <!-- only weave classes in this package -->
    </weaver>
    <aspects>
        <!-- use only this aspect for weaving -->
        <concrete-aspect name="MyAspect_" extends="hu.myAspect">
        <pointcut name="pointcut" expression="execution(public * javax.persistence.EntityManager.*(..)) || execution(public * hu..*.create(..))"/>
        </concrete-aspect>
    </aspects>
</aspectj>
4

1 に答える 1

5

コンパイル時のウィービングにはaop.xmlに完全に相当するものはありませんが、このような特定の側面を含めたり除外したりするようにAspectJmavenプラグインを構成できます。

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.3</version>
    <configuration>
        <includes>
            <include>**/TransationAspect.java</include>
            <include>**/SecurityAspect.aj</include>
        </includes>
        <excludes>
            <exclude>**/logging/*.aj</exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>
于 2010-09-22T09:37:06.713 に答える