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:runMod should use the vertx version that is defined in the module pom.xml #12

Closed bckfnn closed 10 years ago

bckfnn commented 10 years ago

At the moment running a module with vertx:runMod (and runModXXX as well) will use the version of vertx that the plugin is compiled with and not the version that is specified in the modules pom.xml

In the testcase https://github.com/bckfnn/versionfromplugin the pom is set to use vertx 2.0.0 and plugin 2.0.1 but when executing

mvn package vertx:runMod 

a stdout.println show that it is 2.1M1 that is available on the module's classpath.

Showhow it must be possible to specify what version of vertx that is used and the most obvious place would be in the normal dependencies that was used when compiling the module.

purplefox commented 10 years ago

AIUI this is just the way Maven plugins work.

I have no idea if it's possible to get the plugin to use the dependencies of the project you are using it in, as opposed to the plugin itself, but I doubt it.

When a plugin runs, Maven provides it only with a classpath that corresponds to the dependencies of the plugin, not of the project it is being used in.

We had to do some hackery in the maven plugin just to add src/main/resources to the classpath (see plugin code).

purplefox commented 10 years ago

The new archetype creates a pom.xml that allows you to override the vertx version in your own pom.xml now.