Shawn,
It's difficult to give a definitive answer to your questions because there are so many possibilities. A couple of points:
- When a jetty distribution is configured in XML, it is essentially just writing java code in XML that creates some objects, calls some setters, then calls the start method. So anything that can be done in the distribution XML can be done in code.
- LikeJettyXml is an embedded example that sets up pretty much the full server just as jetty.xml does.
- The start.jar is a different matter, as it's job is to build a classpath and a list of XMLs to execute. So you have to replace that by something that will build your classpath (or a fat jar) and call a main method. There are plugins for that kind of thing. Things like lib/ext are really classpath stuff rather than config stuff.
- You also might want to consider java 9/10/11 executable jars for this kind of thing.
It's not really very difficult... other than there is perhaps too much flexibility so it can be hard to know which way to go. My recommendation is to progress by:
- create a main method that initially just does hello world
- make the main method say "hello world "+some constant from a solr class
- Bundle up the main method and dependencies into an executable jar the way you want.
- Add "Server server = new Server(); server.start(); server.join();" to your main method
- Build on that by configuring the server in code until it does what you want.
cheers