idas
idas

Reputation: 11

Jetty plugin server for Maven in Netbeans 8.0.2

I'm trying to run a simple example web application in Netbeans that uses Maven with the jetty plugin but the error -NetBeans: No suitable Deployment Server is defined for the project or globally.

Here is what I am working on in the code area

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.2.4.v20141103</version>
    <configuration>
        <httpConnector>
        <!-- make jetty listen on 127.0.0.1 for better security -->
        <!--host>127.0.0.1</host-->
        </httpConnector>
        <scanIntervalSeconds>3</scanIntervalSeconds>
        <webAppConfig>
        <!-- defaultsDescriptor>src/test/resources/jetty-maven-plugin-webdefault.xml</defaultsDescriptor -->
        </webAppConfig>
    </configuration>
</plugin>

can someone tell me what i'm missing here.

Upvotes: 1

Views: 6729

Answers (1)

Paul Samsotha
Paul Samsotha

Reputation: 208944

It's because you are trying to

[Right Click] → [Run].

This will try to deploy to a normal server, for which you need to have your app configured to run with.

If you want to use the jetty-maven-plugin, you need to run the Maven goal. You can do

[Right Click] → [Custom] → [Goals...] → [Do below] → [OK]

enter image description here

Clicking OK now should start the server. And because you checked the "remember as", next time you [Right Click] → [Custom], you will see the "Run Jetty" shortcut option.

Personally though I never run through Netbeans. For one, you can't ctrl+c to shutdown the server. If you have Maven installed locally, and not just in Netbeans. you can just hit the command line, from the project root and do mvn jetty:run

Upvotes: 2

Related Questions