Missing Maven Plugin Jetty

旧城冷巷雨未停 提交于 2019-12-03 23:25:56
Dariop

Did you add the plugin to the pom.xml? A quick google search found this:

<project>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>

Found here: http://mojo.codehaus.org/jetty-maven-plugin/usage.html

Doug

The instructions at (http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html) say to put the version as ${project.version} which is wrong! Also, the older documentation has the groupId set to org.codehaus.mojo it should be set to org.eclipse.jetty.

I added a real version from the jetty repo (http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/) and changed the groupId.

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.0.5.v20130815</version>
</plugin>
naXa

Check if it works after adding the following in settings.xml as documented.

<pluginGroups>
    <pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>

Also note that there are two different versions of the plugin - the older maven-jetty-plugin and the newer jetty-maven-plugin.
source

Sartaj Singh Sisodiya

Make sure you are executing command 'mvn jetty:run', from inside your project directory. If you will listed the current directory you should see the pom.xml.

If you are in not in your project and running 'mvn jetty:run', will get Error "Missing Maven Plugin Jetty"

        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>8.1.12.v20130726</version>
            <configuration>
                <stopKey>todostop</stopKey>
                <stopPort>9999</stopPort>
            </configuration>
        </plugin>

Hope it will help

I had this problem too. I started jetty:run from within Eclipse using a "Maven Build" run configuration.

The problem was, within my Maven Build run configuration, the "base directory" (i.e. the working directory used by the mvn executable) was set incorrectly. Setting the base directory to the directory containing the pom.xml fixed the problem.

Most probably your version is wrong. Try

    <plugins>
        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <version>9.2.6.v20141205</version>
        </plugin>
    </plugins>

Beside the plugin part you should be in the pom.xml directory to make starting the jetty command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!