cdietschrun
cdietschrun

Reputation: 1683

How to tell jetty-maven-plugin what version of jetty to run?

I want to tell jetty-maven-plugin what version of jetty I want it to run, e.g. 8.1.4 instead of 9.0.0. I don't see it anywhere here

Also, the next step I want is to tell this plugin to use specific plugins that I have configured on top of my jetty. Is this possible?

I have essentially edited the elasticsearch-jetty plugin and want to run that through jetty and maven using this plugin, or really anything that works. Does anyone have any idea/help?

Upvotes: 2

Views: 3826

Answers (3)

imotov
imotov

Reputation: 30163

When you use maven jetty plugin, jetty is hosting your application and you need to start jetty first in order to run your application. In elasticsearch-jetty plugin it's other way around, elasticsearch is hosting jetty. So, in order to run elasticsearch with elasticsearch-jetty from maven, you need to start elasticsearch, not jetty. I would consider using exec-maven-plugin instead.

Upvotes: 1

Stephen Connolly
Stephen Connolly

Reputation: 14116

Just add the following to your <pluginManagement> section

    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <version>8.1.8.v20121106</version>
    </plugin>

Obviously change the version to the exact version you want to run.

Alternatively from the CLI

mvn org.mortbay.jetty:jetty-maven-plugin:8.1.8.v20121106:run

The plugin changed groupId from org.mortbay.jetty to org.eclipse.jetty with the 9.x releases

Upvotes: 3

Lee Meador
Lee Meador

Reputation: 12985

Here (http://www.eclipse.org/jetty/documentation/current/jetty-maven-helloworld.html#configuring-embedded-jetty-with-maven) the jetty version is in the pom dependencies section.

If that doesn't work right, you might try dependencies inside the plugin section for the jetty plugin. There is some info here (http://www.sonatype.com/people/2008/04/how-to-override-a-plugins-dependency-in-maven/)

Or you could try to use an old version of the plugin.

Upvotes: 0

Related Questions