Maven Jettyプラグインの例
簡単に参照できるように、Maven Jetty 8.xおよび9.xプラグインの例はほとんどありません。
1. Maven Jettyプラグイン9.x
Note
Maven Jetty9.xプラグインにはMaven3とJava1.7を使用する必要があります。
1.1 The ‘groupId’ is org.eclipse.jetty
, by default, it runs on port 8080, in root context ‘/’.
pom.xml
org.eclipse.jetty jetty-maven-plugin 9.2.11.v20150529
Maven Jettyプラグインを実行するには
ターミナル
$ mvn jetty:run
デプロイされたURL:http://localhost:8080/
実行中のJettyインスタンスを停止するには
ターミナル
$ ctrl + c
1.2 Change a context path.
pom.xml
org.eclipse.jetty jetty-maven-plugin 9.2.11.v20150529 10 /abc
デプロイされたURL:http://localhost:8080/abc
1.3 Change a different port.
pom.xml
org.eclipse.jetty jetty-maven-plugin 9.2.11.v20150529 10 /abc 8888
デプロイされたURL:http://localhost:8888/abc
または、システムプロパティjetty.port
を手動で渡すことができます。
mvn -Djetty.port=8888 jetty:run
1.4 jetty.xml
example.
pom.xml
org.eclipse.jetty jetty-maven-plugin 9.2.11.v20150529 10 /abc jetty.xml
jetty.xml
デプロイされたURL:http://localhost:1234/abc
Note
その他のJetty
Maven Plugin 9.x Examples
2. Maven Jettyプラグイン8.x
2.1 The ‘groupId’ is org.mortbay.jetty
, by default, it runs on port 8080, in root context ‘/’.
pom.xml
org.mortbay.jetty jetty-maven-plugin 8.1.16.v20140903
2.2 Change a different context path, set seconds to check for changes and automatically hot redeploy.
pom.xml
org.mortbay.jetty jetty-maven-plugin 8.1.16.v20140903 10 /abc
デプロイされたURL:http://localhost:8080/abc
2.3 Change a different port to start.
pom.xml
org.mortbay.jetty jetty-maven-plugin 8.1.16.v20140903 10 /abc 8888
デプロイされたURL:http://localhost:8888/abc
または、システムプロパティjetty.port
を手動で渡すこともできます。
mvn -Djetty.port=8888 jetty:run
P.S The class SelectChannelConnector
is the default Jetty connector.
Note
その他のJetty
Maven Plugin 8.x Examples