Maven码头-org.mortbay.jetty与org.eclipse.jetty [英] maven jetty - org.mortbay.jetty vs org.eclipse.jetty

查看:154
本文介绍了Maven码头-org.mortbay.jetty与org.eclipse.jetty的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用码头使用maven托管一个简单的helloworld servlet.我很困惑.

I'm trying to use jetty to host a simple helloworld servlet using maven. I'm very confused.

我遵循了这些说明,但是当我问题mvn jetty:run,出现以下错误:

I followed these instructions, but when I issue mvn jetty:run, I get the following error:

[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/abc/.m2/repository), central (http://repo.maven.apache.org/maven2)]

更令人困惑的是,当我在网上搜索示例时,有些是指org.mortbay.jetty,而有些是指org.eclipse.jetty.我以为Eclipse版本是最新的,不是吗?

To add to the confusion, when I search the web for examples, some are referring to org.mortbay.jetty, and others to org.eclipse.jetty. I thought that the Eclipse version is the most recent, no?

是否有任何文档描述了 Maven回购是什么意思?以及如何使用它们?

Is there any documentation that describes what each of the dependencies hosted on maven repo mean? And how they can be used?

将版本号修改为9.0.0.v20130308后,出现另一个错误:

After modifying the version number to 9.0.0.v20130308, I get a different error:

Unable to load the mojo 'run' in the plugin 'org.eclipse.jetty:jetty-maven-plugin:9.0.0.v20130308' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/eclipse/jetty/maven/plugin/JettyRunMojo : Unsupported major.minor version 51.0

这是我更新的pom:

<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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.neon.research</groupId>
        <artifactId>jetty</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>jetty Maven Webapp</name>
        <url>http://maven.apache.org</url>
        <properties>
                <jetty.version></jetty.version>
        </properties>
        <dependencies>
                <dependency>
                        <groupId>org.eclipse.jetty.orbit</groupId>
                        <artifactId>javax.servlet</artifactId>
                        <version>3.0.0.v201112011016</version>
                        <scope>provided</scope>
                </dependency>
        </dependencies>

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.eclipse.jetty</groupId>
                                <artifactId>jetty-maven-plugin</artifactId>
                                <version>9.0.0.v20130308</version>
                        </plugin>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.6</source>
                                        <target>jsr14</target>
                                </configuration>
                                <executions>
                                        <execution>
                                                <id>test-compile</id>
                                                <phase>process-test-sources</phase>
                                                <goals>
                                                        <goal>testCompile</goal>
                                                </goals>
                                                <configuration>
                                                        <source>1.6</source>
                                                        <target>1.6</target>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>
</project>

推荐答案

码头已经发生了很多变化-请参阅

Jetty has moved around a lot - see the History. Eclipse is the most recent home, as of 2009. The Maven artifacts have been renamed along the way, so your searches are finding documentation for older versions of Jetty and the maven plugin.

最新(v9) jetty-maven-plugin文档将依赖项列出为:

The latest (v9) jetty-maven-plugin documentation lists the dependency as:

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.0.0.v20130308</version> <!-- latest at time of writing -->
</plugin>

jetty-continuation jetty-jsp 之类的其他库只是Jetty项目的子模块.关于Jetty 7和8的旧版Wiki 上有一些文档,但我看不到有更新的任何内容v9尚未.模块化设计是Jetty开发人员将其代码组织为定义明确的模块,这些模块已单独提供给可能只想使用Jetty的一小部分的开发人员.

The other libraries like jetty-continuation or jetty-jsp are just sub-modules of the Jetty Project. Some documentation exists on the older wiki for Jetty 7 and 8 but I cannot see anything updated for v9 yet. The modular design is the Jetty developer's organisation of their code into well defined modules which have all been made available separately for developers that may want to use just want a small part of Jetty.

这篇关于Maven码头-org.mortbay.jetty与org.eclipse.jetty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆