Compiler Plugin 接受meminitial和maxmem的配置。您可以按照以下示例将初始内存大小设置为 128MB,将最大内存使用量设置为 512MB:
<project> [...] <build> [...] <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.10.1</version> <configuration> <fork>true</fork> <meminitial>128m</meminitial> <maxmem>512m</maxmem> </configuration> </plugin> </plugins> [...] </build> [...] </project>