簡體   English   中英

AOP + Jenkins + Maven集成

[英]AOP + Jenkins + Maven Integration

我正在使用aop,可以在eclipse aop插件的幫助下發布apk。 正如您在aop中已經知道的那樣,在編譯時必須將許多代碼添加到某些預先定義的類中。

但是我不知道該如何通過jenkins + maven自動執行此操作。 明確地說,我想將整個編譯(打包)問題轉移到jenkins + maven平台上。 Maven應該構建應用程序,但是如何?

使用AspectJ Maven插件。 確保您的編譯器插件排除您的方面,而Aspectj編譯器插件僅編譯方面。 像這樣的東西:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.4</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>UTF-8</encoding>
        <excludes>
            <exclude>*.aj</exclude>
        </excludes>
    </configuration>
</plugin>


<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.3</version>
    <configuration>
        <verbose>true</verbose>
        <complianceLevel>1.6</complianceLevel>
        <showWeaveInfo>true</showWeaveInfo>
        <sources>
            <source>
                <basedir>src/main/java</basedir>
                <includes>
                    <include>**/*.aj</include>
                </includes>
            </source>
        </sources>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>test-compile</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.10</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.6.10</version>
        </dependency>
    </dependencies>
</plugin>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM