加入红色的这段:使用maven插件进行编译
<!-- Build -->
<build>
<!-- Tomcat -->
<finalName>${finalName}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<url>http://localhost:8080/manager</url>
<username>tomcat</username>
<password>123456</password>
<path>/${finalName}</path>
</configuration>
</plugin>
<!-- Jetty -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>80</port>
</connector>
</connectors>
<reload>automatic</reload>
<scanIntervalSeconds>10</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>org.mortbay.util.URI.charset</name>
<value>${project.build.sourceEncoding}</value>
</systemProperty>
</systemProperties>
<webDefaultXml>src/main/resources/platform/webdefault.xml</webDefaultXml>
</configuration>
</plugin>
<!--Compiler-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>