文章出處

運行環境:

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 ,上述問題就成功解決了。


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()