Open
Description
Prerequisite checks before starting up dev mode (such as checking for an already running server, or container, and checking the Docker version) should occur as early as possible in the dev goal/task. They should be located in the ci.maven
and ci.gradle
files DevMojo.java
and DevTask.groovy
at the start of the methods doExecute()
and action()
respectfully. The server running check is already located in the correct spot, so checks for the Docker version and for a running container need to be added.
This will require some refactoring, as the DevUtil object is not created at the point where these prereq checks need to occur. There are a few options:
- Create static prereq check methods and convert many existing non-static methods in
DevUtil.java
to static. This leads to difficulties as these methods rely on other non-static methods such aserror()
,warn()
, anddebug()
. It can be a cascade of non-static dependency. - Move the prereq related methods into a parent of DevUtil or into a totally separate Util class.
- Create a "light" instance of a DevUtil object that uses the smallest amount of values in construction, and discard it after running the prereq methods. Create the "real" DevUtil object later on.
- Modify the constructor for DevUtil to be the bare minimum so the "real" DevUtil object can be constructed earlier on and used for the prereq methods. Then use an
init()
method to fully initialize the DevUtil object with all the necessary values that are created after the prereq checks.
Metadata
Metadata
Assignees
Type
Projects
Status
New Issues