问题描述
我有一个注释处理器,可以在其中生成一些.java文件
target / generated-sources /'
但是最终的jar缺少这些文件。
这是我的pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<generatedSourcesDirectory>${project.build.directory}/generated-sources/</generatedSourcesDirectory>
</configuration>
<executions>
<execution>
<id>process-annotations</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<proc>only</proc>
<annotationProcessors>
<annotationProcessor>com.example.demo.processor.AcordMappingProcessor
</annotationProcessor>
</annotationProcessors>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<configuration>
<proc>none</proc>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
我在这里做错了什么?尝试添加build-helper-maven-plugin,但没有任何反应。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifctId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)