Is there a way to pass JVM args via command line to Maven? [duplicate]

I think MAVEN_OPTS would be most appropriate for you. See here: http://maven.apache.org/configure.html In Unix: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS=”-Xms256m -Xmx512m”. This environment variable can be used to supply extra options to Maven. In Win, you need to set environment variable via the dialogue box Add … environment variable … Read more

How to add Access-Control-Allow-Origin to jetty server

Setup the org.eclipse.jetty.servlets.CrossOriginFilter in your web app. Old question/answer on the topic: https://stackoverflow.com/a/8454168/775715 See Jetty Documentation Hub on CrossOriginFilter Use: Quick Start Grab yourself a copy of jetty-servlets.jar. Put the jetty-servlets.jar in your WEB-INF/lib Add the following to your WEB-INF/web.xml <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>GET,POST,HEAD</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>X-Requested-With,Content-Type,Accept,Origin</param-value> </init-param> … Read more

How do I access instantiated WebSockets in Jetty 9?

Two common techniques, presented here in a super simplified chatroom concept. Option #1: Have WebSocket report back its state to a central location @WebSocket public class ChatSocket { public Session session; @OnWebSocketConnect public void onConnect(Session session) { this.session = session; ChatRoom.getInstance().join(this); } @OnWebSocketMessage public void onText(String message) { ChatRoom.getInstance().writeAllMembers(“Hello all”); } @OnWebSocketClose public void onClose(int … Read more

ECDHE cipher suites not supported on OpenJDK 8 installed on EC2 Linux machine

So I’m running a similar setup, with an AWS box running openjdk-1.8.0.51. what solved it for me is to add bouncycastle as a provider like so: Add the bcprov-<verion>.jar to /usr/lib/jvm/jre/lib/ext Edit /usr/lib/jvm/jre/lib/security/java.security adding the following line to the list of providers: security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider (I added it as the 6th entry but you can add higher … Read more

Jetty: How to change startup temp directory

Jetty needs a working directory. Its search order for finding a work directory is as follows: If the WebAppContext has a temp directory specified, use it. If the ServletContext has the javax.servlet.context.tempdir attribute set, and if directory exists, use it. If a ${jetty.base}/work directory exists, use it (only valid for Jetty 9.1+) If a ${jetty.home}/work … Read more