What's a good workflow for coding a frontend for a Java EE application?

316 views Asked by At

The setup is Java EE on a Glassfish server running local on one machine and my frontend development setup running local on my machine, plus git for collaboration.

I'm doing frontend work (mostly CSS, JS and a little HTML) exclusively. So, i only need the browser-rendered HTML. Right now my colleague publishes the application on his local glassfish, grabs the rendered HTML from Firefox and pastes it into a seperate frontend folder in our git repository.

This seems to be a bad workflow.

I guess we could solve this by setting up a development server, but we don't have one, yet.

Is there a way to get the rendered HTML without me running all the Java tools (Eclipse, Java EE, Glassfish) on my machine?

1

There are 1 answers

1
Mike On

It depends on what you want to avoid by not having all those things on your machine.

If your local machine is low on resources, then this may not be the best scenario (depending on how light/heavyweight your application is), but if your main goal is not to clutter your machine with unnecessary things, you may want to try Vagrant.

I've created a Vagrantfile for Payara (a build of GlassFish that fixes some bugs and includes Hazelcast) which means that you could just clone the repo, type vagrant up then vagrant ssh and you're logged in to a headless virtual machine with Payara running as a service.

If you wanted to stick to GlassFish, I'm sure there will be GlassFish Vagrantfiles out there too.

If you added a line to the provision script to wget the latest build of your WAR to the autodeploy folder, your workflow would then just be to start your Vagrant image and visit your application.

Since this is a headless VM, you can run it with very low resources.

The same approach with different tools would be to use Docker, if you're familiar with that.