Some (ok one) have asked me what is MAVEN_DEBUG_OPTS.  That's my bad for not 
being clear.

Adding "-ea" to MAVEN_OPTS will cause assert to be on for maven and maven's 
plugins as well.  That means during clean, install stages, you might hit some 
weird asserts (according to others experience on the web).

So what I did is added it to the script mvnDebug which utilizes 
MAVEN_DEBUG_OPTS.  When I run jetty:run, I always use mvnDebug which sets up 
the debug port for the jvm and with this change also run in assert mode.  You 
always want to use mvnDebug for your own testing of the server anyways because 
you can easily attach for debugging purposes.

The drawback to doing it this way is that the unit tests that are ran during 
the install stage do not hit asserts.  (I think but haven't confirmed yet.)

--Alex

> -----Original Message-----
> From: Alex Huang [mailto:alex.hu...@citrix.com]
> Sent: Tuesday, June 11, 2013 5:18 PM
> To: dev@cloudstack.apache.org
> Subject: Please run with assert on when you're developing...
> 
> Hi All,
> 
> CloudStack code have many asserts to guarantee code is written correctly for
> the developers.  I recently realized that since we've converted to maven, we
> no longer run with assert on as developers.  It is very important that we do
> because it will find problems for you during load time and run time.
> 
> To run with assert on, you can add "-ea" to MAVEN_DEBUG_OPTS.
> 
> I tried this recently and there are many places that are asserting.  Please 
> do a
> run and fix what you can.
> 
> Thanks.
> 
> --Alex

Reply via email to