简体   繁体   中英

Getting maven to start jetty (Tapestry Tutorial)

I'm trying to work through the Tapestry tutorial.

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.

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

I have 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.

This is due to missing maven-jetty-plugin in your pom.xml file :

Add the following dependency in 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

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. You have two choices, define the plugin in your pom, or add the jetty group as a pluginGroup in your settings.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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