2

在成功按照这个HowTo在 Maven 构建中集成 Lombok 和 AspectJ 之后,我的代码不再在 eclipse 中编译。由于缺少通常由 Lombok 生成的 getter/setter/constructor,到处都有很多错误。

我的目标是能够使用 eclipse 使用 Lombok 进行开发,然后使用mvn clean install命令行进行构建。

我试图在 Eclipse 中跳过 AspectJ 编织,但没有成功。这是我用来跳过 AspectJ 的配置文件:

<profile>
        <id>noAspectJ</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>aspectj-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>process-classes</id>
                            <phase>none</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <compilerVersion>1.7</compilerVersion>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
4

1 回答 1

2

我找到的最佳解决方案是从我的 Eclipse 中删除 AspectJ 插件,因为它不需要它。这样我也可以避免使用配置文件。

但是,如果我在 eclipse 中使用 JUnit 测试,这可能会导致一些问题。

于 2015-10-28T12:38:15.383 回答