Maven 常用命令
mvn archetype:generate
mvn install
mvn clean
mvn clean complie
mvn clean test
mvn clean install
mvn clean package
mvn test
mvn package
mvn site
mvn dependency:resolve
mvn dependency:tree
mvn dependency:analyze
配置Maven Jetty插件
setting.xml
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
或者在pom.xml文件中配置
<build>
<finalName>simple-webapp</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</build>
启动Web项目(调用Jetty插件的run目标)
mvn jetty:run
启动完后就可以通过(http://localhost:8080/simple-webapp/)访问。
mvn jetty:run
http://127.0.0.1:8080/
mvn jetty:run -Djetty.port=9999
http://127.0.0.1:9999/