简体   繁体   English

让maven开始码头(Tapestry Tutorial)

[英]Getting maven to start jetty (Tapestry Tutorial)

I'm trying to work through the Tapestry tutorial. 我正在尝试使用Tapestry教程。

I think I got everything set up right and so far so good but I get to the part where the tut rather glibly states: 我想我已经把所有东西设置得正确而且到目前为止这么好但是我到了啧啧相当明亮的部分

Change into the newly created directory, and execute the command: 切换到新创建的目录,然后执行命令:

mvn jetty:run

Again, the first time, there's a dizzying number of downloads, but before you know it, the Jetty servlet container is up and running. 同样,第一次,下载次数令人眼花缭乱,但在您知道之前,Jetty servlet容器已启动并运行。

I wish! 我希望! that only results in the following error. 只会导致以下错误。

The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found 插件'org.apache.maven.plugins:maven-jetty-plugin'不存在或找不到有效版本

I have maven-2.2.0, Jetty-5.1.9 我有maven-2.2.0,Jetty-5.1.9

The only thing I did different to what the tutorial stated was I used archetype:generate instead of archetype:create as create failed and noted it was deprecated and suggested generate instead. 我做的唯一与教程所说的不同的是我使用了archetype:generate而不是archetype:create as create failed并注意到它已被弃用并建议生成

This is due to missing maven-jetty-plugin in your pom.xml file : 这是因为你的pom.xml文件中缺少maven-jetty-plugin:

Add the following dependency in pom: 在pom中添加以下依赖项:

<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.0.1</version>
      </plugin>

now mvn clean install and then jetty run it will work 现在mvn clean install然后jetty运行它会工作

It can't find it because it's not in the default org.apache.maven.plugins or org.codehaus.mojo locations where Maven looks by default to map the prefix to an artifactId. 它找不到它,因为它不在默认的org.apache.maven.plugins或org.codehaus.mojo位置,默认情况下Maven会将前缀映射到artifactId。 You have two choices, define the plugin in your pom, or add the jetty group as a pluginGroup in your settings.xml 您有两种选择,在pom中定义插件,或者在settings.xml中将jetty组添加为pluginGroup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM