Mark Estrada
Mark Estrada

Reputation: 9201

Missing Maven Plugin Jetty

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>

Upvotes: 15

Views: 52293

Answers (7)

dicle
dicle

Reputation: 1162

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

Upvotes: 0

Dario Pedol
Dario Pedol

Reputation: 2110

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

Upvotes: 8

naXa stands with Ukraine
naXa stands with Ukraine

Reputation: 37993

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

Upvotes: 4

Sartaj Singh Sisodiya
Sartaj Singh Sisodiya

Reputation: 1143

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

Upvotes: 3

Doug
Doug

Reputation: 2312

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>

Upvotes: 32

jprism
jprism

Reputation: 3494

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>

Upvotes: 0

Abdull
Abdull

Reputation: 27862

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.

Upvotes: 2

Related Questions