vert-x / vertx-maven

Vert.x 2.x is deprecated - use instead
https://github.com/vert-x3/vertx-maven-starter
Other
22 stars 31 forks source link

vertx:runModEclipse does not loaded classes from target/classes. #13

Closed bckfnn closed 10 years ago

bckfnn commented 10 years ago

I would expect that using eclipse and maven for compiling and vertx:runModEclipse for running would work together:

In the testcase https://github.com/bckfnn/modsorclasses.git running

mvn eclipse:eclipse
mvn package
mvn vertx:runModEclipse

Show with a stdout.print that the PingVerticle.class is not loaded from target/classes where eclipse will write new version, but is actually loaded from target/mods/...

This is confusing since vertx:runModEclipse is supposed to run from the resources of the IDE.

IMO runModEclipse should find PingVerticle.class where a mavenized eclipse project stores the output class files, ie. in target/classes.

purplefox commented 10 years ago

Trying with the latest plugin (2.0.1-final)...

I am not a Maven/Eclipse user but I had a dig and this issue seems to occur because Maven projects in Eclipse don't seem to use the standard Eclipse "bin" directory for output but instead use target/classes. If you go to project... settings.... build path and change output directory back to bin things seem to work ok.

I have tested this with the PingVerticle setting auto-redeploy to true and as I make changes in the IDE they are automatically picked up and the module is redeployed

purplefox commented 10 years ago

Alternatively if you don't want to change output directory you can use mvn runModOnCP and edit the pom.xml (uncomment the commented section) to provide the correct classpath to the verticle:

https://github.com/vert-x/vertx-maven/blob/master/archetype/src/main/resources/archetype-resources/pom.xml#L121

I tested this and it works too.

purplefox commented 10 years ago

runmodXXX now no longer exists and a vertx_classpath.txt is used to configure classpath