maven jetty-org.mortbay.jetty vs org.eclipse.jetty

maven jetty-org.mortbay.jetty vs org.eclipse.jetty,maven,jetty,Maven,Jetty,我正试图使用jetty使用maven托管一个简单的HelloWorldservlet。我很困惑 我遵循了这些,但是当我发布mvnjetty:run时,我得到了以下错误: [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 repositor

我正试图使用jetty使用maven托管一个简单的HelloWorldservlet。我很困惑

我遵循了这些,但是当我发布
mvnjetty:run
时,我得到了以下错误:

[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版本是最新的,不是吗

是否有任何文档描述托管在上的每个依赖项的含义?如何使用它们

将版本号修改为
9.0.0.v20130308
后,我得到了一个不同的错误:

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>

4.0.0
com.neon.research
码头
战争
1.0-快照
jetty Maven Webapp
http://maven.apache.org
org.eclipse.jetty.orbit
javax.servlet
3.0.0.v201112011016
假如
org.eclipse.jetty
jetty maven插件
9.0.0.v20130308
maven编译器插件
1.6
jsr14
测试编译
过程测试源
测试编译
1.6
1.6

eclipse版本是最新的版本。按照他们网站上的说明进行操作。

Jetty移动了很多地方-请参阅。截至2009年,Eclipse是最近的一个家。Maven工件已经被重命名,因此您的搜索正在查找Jetty和Maven插件的旧版本的文档

最新版本(v9)将依赖项列为:

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

org.eclipse.jetty

对于Jetty 7和8,但我还看不到v9有任何更新。模块化设计是Jetty开发人员将其代码组织成定义良好的模块,这些模块都单独提供给可能只想使用Jetty一小部分的开发人员。

以下是我的工作配置。 使用最新的Jetty版本

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.4.0.v20161208</version>
    <configuration>
        <scanIntervalSeconds>0</scanIntervalSeconds>
        <contextXml>${basedir}/src/it/resources/jetty-context.xml</contextXml>
        <webApp>
            <contextPath>/yourContextPath</contextPath>
        </webApp>
        <contextHandlers>
        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
            <war>your/path.war</war>
            <contextPath>/yourPath</contextPath>
        </contextHandler>
        </contextHandlers>
        <classesDirectory></classesDirectory>
        <webAppSourceDirectory></webAppSourceDirectory>
    </configuration>
</plugin>

org.eclipse.jetty
jetty maven插件
9.4.0.v20161208
0
${basedir}/src/it/resources/jetty-context.xml
/yourContextPath
你的路径
/你的道路

您指定了插件组ID了吗?是的-这是我的资料:org.eclipse.jetty jetty maven plugin 9.0.0版本不正确,请查看我的更新答案和评论。您现在的版本与Java不匹配。Jetty9需要Java1.7Thank和Yb。我安装了1.7,现在它可以工作了。我不知道你怎么知道它是java版本:-)Jetty 9文档在这里:@jessemcconnell谢谢,我已经链接到了。我试图解释,没有什么比v9的旧wiki文档更好的了。例如,没有依赖关系图页,也没有单独的页。@adnyb谢谢。我不确定我遗漏了什么,因为我像你描述的那样设置了我的插件。我还指示版本为9.0.0。@andyb-谢谢您的后续操作。我试过你的建议,但现在我犯了一个不同的错误。我已经更新了新的错误和pom文件。您现在的版本与Java不匹配。Jetty9需要Java1.7