Dropwizard RAD (Rapid Application Development)

3,522 views
Skip to first unread message

Piero Ottuzzi

unread,
Jan 22, 2013, 8:37:44 AM1/22/13
to dropwiz...@googlegroups.com
Hi there,

   I'm quite new to dropwizard, maven and runnable services in fat-jar.
Actually when I try some dropwizard code (mostly tutorial at this time) my workflow is:
  1. edit some code in a IDE (Eclipse Indigo in my case)
  2. mvn package (using either IDE maven tool or from command line)
  3. java -jar target/hello-world-0.0.1-SNAPSHOT.jar
  4. check latest modifications

This is quite tedious and I do not feel very productive: is there a smarter way to develop for dropwizard?
How do you approach first development stage when you have to write a lot of code and add a lot of changes continuously?

Thanks in advance for your advice.
Bye
Piero


Matt Luedke

unread,
Jan 22, 2013, 8:50:39 AM1/22/13
to dropwiz...@googlegroups.com
Hi,

Write unit tests that cover as much of that code as you can. Also, note a recent thread about setting up integration tests: https://groups.google.com/forum/#!topic/dropwizard-user/YpQMnqvP_dU
You can run these tests inside of Eclipse, no 'mvn package' necessary.

Also, if there is something that you cannot test this way, you can start Dropwizard from inside Eclipse. 
Under the "Arguments" tab inside "Run Configurations," add "server yourconfig.yml" and you are good to go.

Ryan Kennedy

unread,
Jan 22, 2013, 3:19:04 PM1/22/13
to dropwiz...@googlegroups.com
I run in an IDE (IntelliJ) in debug mode. For some code changes you can recompile and IntelliJ will reload the class live. In some cases it cannot, in which case you simply reload the process. Unless you have a process that does a lot of up front work on startup, this can be done in a matter of seconds.

-- 
Ryan Kennedy

Steven Nelson

unread,
Jan 22, 2013, 3:24:26 PM1/22/13
to dropwiz...@googlegroups.com

I am running Eclipse Juno and I have a debug run setup with the required arguments and all I have to do is execute that run configuration.

 

1)      Create a new run configuration for a Java Application

2)      Set the project as the project containing your Service class

3)      Set the Main class as your Service Class

4)      In the arguments tab specify: server config.yml

5)      Click Run


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2221 / Virus Database: 2639/5549 - Release Date: 01/21/13

Piero Ottuzzi

unread,
Jan 28, 2013, 8:28:57 AM1/28/13
to dropwiz...@googlegroups.com
Hi Steve,

    sorry for late reply... I did not have time to test your tip but now I can say thank you very much!

Bye
Piero

Christophe Furmaniak

unread,
Feb 13, 2013, 7:33:27 AM2/13/13
to dropwiz...@googlegroups.com
you could also give a try to jrebel on top of that

Matt Brown

unread,
Feb 13, 2013, 3:53:04 PM2/13/13
to dropwiz...@googlegroups.com
As one more option, you could also use the maven-exec-plugin to launch the service from the command line without packaging:

    mvn compile exec:java -Dexec.mainClass=your.main.class -Dexec.args="server config.yml"

John Glynn

unread,
Feb 14, 2013, 5:21:58 PM2/14/13
to dropwiz...@googlegroups.com
Unit tests + JRebel

Christophe Furmaniak

unread,
Feb 15, 2013, 3:19:02 AM2/15/13
to dropwiz...@googlegroups.com
Actually, the main thing you have to keep in mind: you don't need to build the fat jar to be able to run dropwizard during dev phase

you can go with you IDE "run ..." feature or through mvn exec; all of them can be combined with JRebel.

Of course, don't forget to use unit tests :)

Keith Bloomfield

unread,
May 20, 2013, 9:10:11 PM5/20/13
to dropwiz...@googlegroups.com
Just what I was looking for. Thanks Steve!

Nathan Fisher

unread,
May 21, 2013, 5:01:52 PM5/21/13
to dropwiz...@googlegroups.com
For anyone interested, the specific cases according to the IntelliJ docs state that it can only reload if a method is changed not a signature (I would expect similar limitations from Eclipse). (http://www.jetbrains.com/idea/webhelp/reloading-classes.html)
Reply all
Reply to author
Forward
0 new messages