Page 1 of 1

fastest way to execute server development cycle?

PostPosted: Sun Jan 15, 2012 2:58 am
by Funktopus
Hi all,

I'd like to make some code contributions to Subsonic, particularly the server component. Prior to getting started, I was wondering what the fastest way is to execute the classical code/compile/test cycle. Packaging everything up to an installable after every change isn't an option as it pretty much contradicts the notion of fast turnaround times.

So I've already checked out the code and set things up within Eclipse. To my understanding, a Maven install run leads to a WAR file. Am I correct in assuming that in order to see how code changes behave, one would need an application server like Jetty and deploy that WAR file within? As of now, I've been dealing with standalone Java applications only that didn't need any third-party bootstrapping component like Jetty, so the development approach is not perfectly clear to me yet. I am particularly curious whether there's a way to take advantage of Eclipse's debugging capabilities (e.g., breaking at certain locations) in a most productive way when testing a new piece of Subsonic backend code.

Thanks in advance!

Re: fastest way to execute server development cycle?

PostPosted: Sun Jan 15, 2012 11:26 am
by Funktopus
Doing further investigations, I was able to answer the question myself. The solution is simpler than I initially thought.

Basically, you can fire up the Subsonic server directly from any IDE by starting the main method in the class net.sourceforge.subsonic.booter.Main (part of the subsonic-booter project). In Eclipse, you would create a new Debug Configuration and set things accordingly. Moreover, you may need to provide additional parameters to ensure flawless bootup such as:

  • Change the working directory to subsonic-main/target to allow the WAR file (created during the Maven build process) to be found.
  • Specify a different Subsonic home directory with -Dsubsonic.home=<new home directory> as the initial one requires root privileges on my Mac machine
  • Change the listening host with -Dsubsonic.host for security reasons
  • Change the listening port with -Dsubsonic.port as the initial port 80 requires root privileges too

Additional parameters may be required but this basic setup brings you to the initial login page when accessing http://<host>:<port>/subsonic/. I was able you set all parameters within Eclipse's Debug Configuration; it should be similarly feasible with other IDEs such as IntelliJ.

I'll try to add these instructions to the wiki as well.

Re: fastest way to execute server development cycle?

PostPosted: Sun Jan 15, 2012 3:00 pm
by BKKKPewsey
:D I am glad you could answer your own question as being a non-programmer (with modern stuff at least)
I was still trying to get me head around your original post :)
Hopefully that info should help somebody but if you put it into the wiki could you try to simplify it a bit if possible for us non-techies :?

Re: fastest way to execute server development cycle?

PostPosted: Sun Jan 15, 2012 3:45 pm
by Funktopus
Hey there,

BKKKPewsey wrote::D I am glad you could answer your own question as being a non-programmer (with modern stuff at least)
I was still trying to get me head around your original post :)
Hopefully that info should help somebody but if you put it into the wiki could you try to simplify it a bit if possible for us non-techies :?


Still waiting for Sindre for approve my wiki edit privileges request. As soon as I get it, I will put together something on the wiki -- will try to be as comprehensible as possible.

If you don't mind I'll report back here once the wiki is updated and ask for you to proof-read regarding "non-techie compliance". :-)

Cheers,

funktopus

Re: fastest way to execute server development cycle?

PostPosted: Sun Jan 15, 2012 5:14 pm
by BKKKPewsey
Be happy to - remember no words with more then 3 syllables :lol: