If you are using jetty with maven and getting below exception

No plugin found for prefix jetty in the current project

If you are using jetty with maven and getting below exception:

[ERROR] No plugin found for prefix ‘jetty’ in the current project and in the plugin groups [org.apache.maven.plugin
s, org.codehaus.mojo] available from the repositories [local (C:\Users\JavaHonk\.m2\repository), central (https://repo.
maven.apache.org/maven2)] -> [Help 1]

Solution: You will have to add below org.mortbay.jetty to the list of groupIds in your settings.xml that get looked up by default when running mvn:

<pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
	<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>

Default minimal pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <packaging>war</packaging>
  <groupId>org.eclipse.jetty.demo</groupId>
  <artifactId>jetty-helloworld-webapp</artifactId>
  <version>1.0</version>
  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.3.0.RC2</version>
      </plugin>
    </plugins>
  </build>
</project>

Leave a Reply

Your email address will not be published. Required fields are marked *