Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run jetty from within intellij?

How can I start up a jersey or spring mvc app from intellij (ultimate edition) using jetty adn debug an api call and break on the end point?

I don't won't to setup a config and have to run $ mvnDebug jetty:run.

I'd like to click a button and have it start from my .war project. Any ideas? thx.

[assume: I have jetty installed and plugin configured....i can run with mvnDebug jetty:run from cmd line and connect with debug session from intenllij but I occasionally get the following and they are annoying:

ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options. Error occurred during initialization of VM]

like image 965
genxgeek Avatar asked Feb 16 '15 21:02

genxgeek


1 Answers

You can also add jetty plugin to maven:

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.2.2.v20140723</version>
        </plugin>
    </plugins>
</build>

And then run maven command to start server and deploy application:

mvn jetty:run
like image 198
Daniel Michalski Avatar answered Nov 08 '22 11:11

Daniel Michalski