Set the environment variable MAVEN_OPTSto -ea. Jetty runs by default in the Maven process and thus affects this setting.
There is also an interesting library called Force Assertions that intercepts the Java 1.6 compilation process. At compile time, everything is assert cond : detail;transparently compiled into blocks if (!cond) throw new Assertion(detail);, which means that statements will always work regardless of the JVM parameters. Worth checking out.
source
share