2015-05-27 80 views

回答

0

你必須從子目錄開始:

$ cd demo-base 
    $ java -jar ../start.jar 
+0

thanx。有用! –

0

最好的學習,便於開發和部署行家。 http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html

maven將幫助AUTO自動下載設置jetty所需的依賴項,並且也更簡單的配置。

$命令mvn碼頭:運行

使用Maven使用這個pom.xml的部署:

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.youcompany</groupId> 
    <artifactId>runjetty</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <maven.compiler.source>1.7</maven.compiler.source> 
     <maven.compiler.target>1.7</maven.compiler.target> 
     <maven.test.skip>true</maven.test.skip>   
    </properties> 
    <build>   
     <plugins> 
      <plugin> 
       <groupId>org.eclipse.jetty</groupId> 
       <artifactId>jetty-maven-plugin</artifactId> 
       <version>9.2.10.v20150310</version> 
       <configuration> 
        <connectors> 
         <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> 
          <port>8080</port> 
          <maxIdleTime>60000</maxIdleTime> 
          <responseHeaderSize>16192</responseHeaderSize> 
         </connector> 
        </connectors> 
        <webApp> 
         <contextPath>/yourWebApp</contextPath> 
        </webApp> 
        <war>C:/pathto/yourwebapp.war</war> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project>