I create a project by the Vert.x starter, use command mvn exec:java
to start.
And when I add the redeploy arguments,
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<configuration>
<mainClass>io.vertx.core.Launcher</mainClass>
<arguments>
<argument>run</argument>
<argument>--redeploy=src/**/*.java</argument> <!-- just add this line -->
<argument>${main.verticle}</argument>
</arguments>
</configuration>
</plugin>
get a error:
java.lang.Exception: classworlds configuration not specified nor found in the classpath
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:397)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
how to make this Vert.x project support auto redeploy?
The
exec:java
goal runs the application in the current VM. As a consequence, thejava.class.path
system property is set to the classpath that started Maven.Unfortunately, this is what the Vert.x redeploy mode uses to determine the classpath of the Vert.x app that it should start as a forked process. This is why classes are missing and this exception is printed.
As a workaround, you can switch to the
exec:exec
goal and this configuration: