【问题标题】:AOP + Jenkins + Maven IntegrationAOP + Jenkins + Maven 集成
【发布时间】:2014-02-03 07:50:52
【问题描述】:

我正在使用 aop 并且可以在 eclipse aop 插件的帮助下发布 apk。正如您在 aop 中已经知道的那样,在编译时必须将大量代码添加到一些预先声明的类中。

但是如果我想通过 jenkins + maven 自动化这个操作,我不知道该怎么做。需要明确的是,我想将整个编译(打包)问题转移到 jenkins + maven 平台上。 Maven 应该构建应用程序,但如何构建?

【问题讨论】:

    标签: java android maven jenkins aop


    【解决方案1】:

    使用 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>
    

    【讨论】:

      猜你喜欢
      • 2020-09-08
      • 2012-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-02
      • 1970-01-01
      • 1970-01-01
      • 2020-03-01
      相关资源
      最近更新 更多