IntelliJ IDEA的Maven项目在修改时报java.lang.OutOfMemoryError: PermGen space异常

时间:2023-03-08 22:10:21

什么也不说了---内存溢出,遇见太多回了,下面是解决方式:

1.在项目设置中新建Maven,然后设置VM:

IntelliJ IDEA的Maven项目在修改时报java.lang.OutOfMemoryError: PermGen space异常

2. 在pom.xml添加下面2个插件,一个是jrebel的,一个是jetty的

  <build>
<finalName>shuyangyang</finalName>
<plugins>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin> <plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8981</port>
<headerBufferSize>16192</headerBufferSize>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>

注:如果添加不了,在pom.xml添加下面的仓库地址就可下载:

    <repositories>
<repository>
<id>Sonatype</id>
<name>Sonatype Repository</name>
<url>http://maven.oschina.net/home.html</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

后记:在我的为之笔记有补充方法。