使用 IDEA 創建 Maven Web 項目 (異常)- Disconnected from the target VM, address: '127.0.0.1:59770', transport: 'socket'


運行環境:

JDK 版本:1.8

Maven 版本:apache-maven-3.3.3

IDEA 版本:14

maven-jetty-plugin 配置:

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
        <webAppSourceDirectory>${project.basedir}/web</webAppSourceDirectory>
        <scanIntervalSeconds>10</scanIntervalSeconds>
        <httpConnector>
            <port>8081</port>
        </httpConnector>
        <stopKey>shutdown</stopKey>
        <stopPort>9966</stopPort>
        <webApp>
            <contextPath>/${project.artifactId}</contextPath>
        </webApp>
    </configuration>
</plugin>

控制台輸出異常信息:

"C:\Program Files\Java\jdk1.8.0_65\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59770,suspend=y,server=n -Dmaven.home=D:\apache-maven-3.3.3 -Dclassworlds.conf=D:\apache-maven-3.3.3\bin\m2.conf -Dfile.encoding=UTF-8 -classpath "D:\apache-maven-3.3.3\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.2\lib\idea_rt.jar" org.codehaus.classworlds.Launcher -Didea.version=14.0.2 jetty:run
Connected to the target VM, address: '127.0.0.1:59770', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:59770', transport: 'socket'
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
Process finished with exit code 1

解決方法:

網上說是由於 IDEA 與 Maven 的版本不兼容造成的上述問題(原文地址:http://bbs.51cto.com/thread-1147659-1.html),把 Maven 改成 apache-maven-3.1.1-bin ,上述問題就成功解決了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM