最新版的eclipse luna 对于osgi的依赖异常麻烦,为了运行jetty需要添加一下依赖的bundle
就在这做个总结吧,方便参考,
id State Bundle
0 ACTIVE org.eclipse.osgi_3.10.1.v20140909-1633
1 ACTIVE org.apache.commons.logging_1.1.1.v201101211721
2 ACTIVE org.apache.felix.gogo.runtime_0.10.0.v201209301036
3 ACTIVE org.eclipse.equinox.http.jetty_3.0.200.v20131021-1843
4 ACTIVE org.eclipse.equinox.console_1.1.0.v20140131-1639
5 ACTIVE org.apache.felix.gogo.shell_0.10.0.v201212101605
6 ACTIVE javax.servlet_3.0.0.v201112011016
7 ACTIVE org.apache.commons.logging_1.0.4.v201101211617
8 ACTIVE org.eclipse.equinox.http.servlet_1.1.500.v20140318-1755
9 ACTIVE org.eclipse.osgi.services_3.4.0.v20140312-2051
10 ACTIVE org.eclipse.jetty.http_8.1.14.v20131031
11 ACTIVE org.eclipse.jetty.io_8.1.14.v20131031
12 ACTIVE org.eclipse.jetty.util_8.1.14.v20131031
13 ACTIVE org.eclipse.jetty.server_8.1.14.v20131031
14 ACTIVE org.eclipse.jetty.continuation_8.1.14.v20131031
15 ACTIVE org.eclipse.jetty.servlet_8.1.14.v20131031
16 ACTIVE org.eclipse.jetty.security_8.1.14.v20131031
17 ACTIVE org.eclipse.jetty.webapp_8.1.3.v20120522
18 ACTIVE org.eclipse.jetty.xml_8.1.3.v20120522
同时如果是linux下,访问80端口需要权限所以在Run Configurations 中运行配置里面的 Arguments 页签,在 VM arguments 中添加-Dorg.osgi.service.http.port=8080
这样就可以运行了,一般同一版本的osgi不会出现版本问题,就是不用修改版本依赖