jetty:run啓動項目報錯,以及注意事項

jetty啓動項目報錯:

No plugin found for prefix 'jetty' in the current project and in the plugin groups ......

解決辦法:

在該項目的pom.xml中的plugins節點下添加如下代碼:

<plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <webApp>
                        <contextPath>/</contextPath>
                    </webApp>
                    <stopKey>webx</stopKey>
                    <stopPort>9999</stopPort>
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>8080</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                    <requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">
                        <filename>target/access.log</filename>
                        <retainDays>90</retainDays>
                        <append>false</append>
                        <extended>false</extended>
                        <logTimeZone>GMT+8:00</logTimeZone>
                    </requestLog>
                    <systemProperties>
                        <systemProperty>
                            <name>productionMode</name>
                            <value>${productionMode}</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>

            </plugin>

需要注意事項:

 代碼中:<contextPath>/</contextPath>是項目請求的路徑,需要自己去修改下,闢如改爲:/weiwei-web等

               <port>8080</port>端口號也需要修改

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章