问题描述
即使我只更改其中一个类,Maven也会始终重新编译所有类.我使用此插件配置:
Even if I only change one of my classes, Maven always recompiles all of them. I use this plugin configuration:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<staleMillis>1</slateMillis>
<useIncrementalCompilation>true</useIncrementalCompilation>
</configuration>
</plugin>
</plugins>
mvn compile
,mvn package
和mvn install
会发生这种情况.
This happens with mvn compile
, mvn package
and mvn install
.
当然,如果您有10-15个文件,这不是问题.但是,我有1000多个源文件,并且需要很多时间.
Of course this is not a problem if you have 10-15 files. However, I have more than one thousand source files and it takes a lot of time.
Maven编译器插件是否具有一些隐藏设置以仅重新编译已修改的文件?有什么解决方法吗?
Does the Maven compiler plugin have some hidden settings to recompile only modified files? Are there any workarounds?
推荐答案
https://issues.apache.org /jira/browse/MCOMPILER-209
使用保加利亚表示法(是<->否)
Use it with Bulgarian notation (yes <-> no)
<useIncrementalCompilation>false</useIncrementalCompilation>
表示真,反之亦然
这篇关于Maven编译器重新编译所有文件,而不是修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!