15

I am having trouble folowing this http://hrycan.com/2012/03/28/primefaces-lazy-loading-datatable-for-jsf2/

It says I should just run

mvn jetty:run

but I keep on encountering this error.

org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found
for prefix 'jetty' in the current project and in the plugin groups [org.apache.m
aven.plugins, org.codehaus.mojo] available from the repositories [local (C:\MyRepo), central (http://repo1.maven.org/maven2)]
        at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.r

I used Maven 3 here.

Any thoughts?

ADD:

From the link, it has this already in the pom.xml

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>7.5.1.v20110908</version>
    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        </dependency>
    </dependencies>
</plugin>
Jean-Rémy Revy
  • 5,431
  • 3
  • 36
  • 64
Mark Estrada
  • 8,275
  • 34
  • 107
  • 173
  • possible duplicate of ["Plugin not found for prefix" error in Eclipse](http://stackoverflow.com/questions/7414075/plugin-not-found-for-prefix-error-in-eclipse) – naXa Aug 19 '14 at 09:35

7 Answers7

32

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>
Jean-Rémy Revy
  • 5,431
  • 3
  • 36
  • 64
Doug
  • 2,022
  • 2
  • 17
  • 16
8

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

mtyson
  • 7,100
  • 13
  • 56
  • 97
Dariop
  • 1,981
  • 12
  • 23
  • 1
    Oh sorry forgot to add this.. it has this plugin – Mark Estrada May 03 '12 at 07:06
  • 9
    Did not work "as is" for me. I had to set the groupId line as `org.mortbay.jetty`. I also had to fully qualify the plugin the first time I run maven: `mvn org.mortbay.jetty:jetty-maven-plugin:run`. This is hardly as simple as Dariop answer seems to imply (at least for complete n00bs like me). – rsenna May 16 '13 at 19:49
  • please see the instructions by @Doug – Erik Nov 24 '13 at 21:04
  • the new groupId is `org.eclipse.jetty` – Robert Mikes Jul 13 '17 at 23:54
4

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

Community
  • 1
  • 1
naXa
  • 26,677
  • 15
  • 154
  • 213
  • Answers to the duplicate of this Question (http://stackoverflow.com/q/27737918/1357094) have more details for the settings.xml – cellepo Dec 30 '15 at 08:27
3

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

Jean-Rémy Revy
  • 5,431
  • 3
  • 36
  • 64
Sartaj Singh Sisodiya
  • 1,043
  • 11
  • 10
  • What does "If you will listed the current directory you should see the pom.xml" mean? – Pere Nov 22 '16 at 12:02
2

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.

Abdull
  • 23,005
  • 22
  • 116
  • 159
0

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>
jprism
  • 2,680
  • 2
  • 32
  • 45
0

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

dicle
  • 932
  • 1
  • 8
  • 35