AspectJ Maven插件获取java.lang.NullPointerException

AspectJ Maven插件获取java.lang.NullPointerException,java,maven,aspectj,lombok,aspectj-maven-plugin,Java,Maven,Aspectj,Lombok,Aspectj Maven Plugin,我有一架121级的飞机。我使用Maven进行编译。我首先使用lombok maven插件生成源代码,然后使用aspectj maven插件进行编译和编织 但是,当我试图用aspectj maven插件编译时。但当“编译和编织”这一步到来时,我得到了: [DEBUG] Compiling and weaving 121 sources to C:\eclipse\Dev01\foo\target\classes [DEBUG] Arguments file written : C:\eclipse

我有一架121级的飞机。我使用Maven进行编译。我首先使用lombok maven插件生成源代码,然后使用aspectj maven插件进行编译和编织

但是,当我试图用aspectj maven插件编译时。但当“编译和编织”这一步到来时,我得到了:

[DEBUG] Compiling and weaving 121 sources to C:\eclipse\Dev01\foo\target\classes
[DEBUG] Arguments file written : C:\eclipse\Dev01\foo\target\classes\builddef.lst
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[DEBUG] Pipelining compilation
[ERROR] Internal compiler error: java.lang.Exception: java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:172)
    C:\eclipse\Dev01\foo\target\generated-sources\delombok\com\net\internet\foo\cc\menumobilecc\po\Bar.java:0
(no source information available)

[DEBUG] weaver operating in reweavable mode.  Need to verify any required types exist.
ajc命令行大约有40000个字符,如下所示:

ajc -Xajruntimetarget:1.5 -1.8 -encoding Cp1252 -showWeaveInfo -source 1.8 -target 1.8 -verbose -classpath <allBuildPath> -d <allClassesInAbsolutPath>
ajc-Xajruntimetarget:1.5-1.8-encoding Cp1252-showWeaveInfo-source 1.8-target 1.8-verbose-classpath-d
这种编译适用于所有项目,但不适用于本项目

    <build>
        <plugins>
            <plugin>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-maven-plugin</artifactId>
                <version>1.18.10.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>delombok</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <addOutputDirectory>false</addOutputDirectory>
                    <outputDirectory>${project.build.directory}/generated-sources/delombok</outputDirectory>
                    <sourceDirectory>src/main/java</sourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.11</version>
                <configuration>
                    <showWeaveInfo>true</showWeaveInfo>
                    <complianceLevel>1.8</complianceLevel>
                    <source>1.8</source>
                    <target>1.8</target>
                    <verbose>true</verbose>
                    <sources>
                        <source>
                            <basedir>${project.build.directory}/generated-sources/delombok</basedir>
                            <excludes>
                                <exclude>**\src\main\java\*</exclude>
                            </excludes>
                        </source>
                    </sources>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>1.9.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <packagingExcludes>**/.svn/</packagingExcludes>
                    <archive>
                    
                        <manifestEntries>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                    <warSourceDirectory>/WebContent</warSourceDirectory>
                    <webappDirectory>WebContent</webappDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.basedir}/WebContent/WEB-INF/lib</directory>
                        </fileset>
                        <fileset>
                            <directory>${project.basedir}/WebContent/WEB-INF/classes</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>pre-clean</id>
                        <phase>pre-clean</phase>
                        <configuration>
                            <target>
                                <delete dir="./target/test-classes" quiet="true" />
                                <delete dir="./target/generated-sources/delombok" quiet="true" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <configuration>
                            <target>
                                <delete dir="./target/test-classes" quiet="true" />
                                <delete dir="./target/generated-sources/delombok" quiet="true" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

org.projectlombok
lombok maven插件
1.18.10.0
生成源
德隆博克
假的
${project.build.directory}/generated sources/delombok
src/main/java
org.codehaus.mojo
aspectj maven插件
1.11
真的
1.8
1.8
1.8
真的
${project.build.directory}/generated sources/delombok
**\src\main\java\*
过程源
编译
org.aspectj
aspectjtools
1.9.2
maven编译器插件
3.1
1.8
1.8
假的
org.apache.maven.plugins
maven战争插件
**/.svn/
${project.name}
${project.version}
/网络内容
网络内容
org.apache.maven.plugins
maven清洁插件
${project.basedir}/WebContent/WEB-INF/lib
${project.basedir}/WebContent/WEB-INF/classes
org.apache.maven.plugins
maven antrun插件
预清洁
预清洁
跑
安装
安装
跑

如果有人能救我?

这是一个有趣的问题,但是如果没有一个(最好是在GitHub上),我不能说太多,因为我无法重现您的问题。我的感觉是,在某个地方你做了一些比必要的更复杂的事情。为什么所有类都在类路径上,而不仅仅是目录或JAR归档?为什么需要AntRun来清理目录?这看起来有点做作。顺便说一句,这和你的工作有关吗?谢谢你的帮助。我不能生产MCVE,因为我不知道问题来自哪里。我不能给你消息来源。我知道这很悲伤:/。如果没有人能帮我找到这些线索,我会在找到一些线索后提出我的解决方案。你通常创建MCVE的方法是,一点一点地取下原件,直到你有最小的版本仍在复制错误。这样做还可以帮助您了解问题的副作用。然后可以选择将类和包名称重命名为伪名称,这样我就无法再识别原始代码了。IDE应该可以帮助您快速完成这项工作。如果你真的想创建MCVE,总有一种方法。你是一个开发者!你甚至可以把它放到私人GitHub回购协议中,只与我分享。发挥你的想象力!