Recent Changes - Search:

edit SideBar

How to build vert.x

Issues

What I would like to be able to do is to run Ptolemy and browse the source of Vert.x so that I can debug Vert.x code.

Unfortunately, this is difficult.

  • It seems like the Vert.x 3.1.0 release was done from the master of the Vert.x git repo. In addition, there are multiple repos involved.

How to build Vert.x under Eclipse

While failing to build, I had an error about ChildInheritingDataObjectConverter missing. Searching for that found: ChildInheritingDataObjectConverter cannot be resolved, which suggested running mvn clean install to create ChildInheritingDataObjectConverter.java.

Below are the steps necessary:

  1. Download and build the vert.x repo
    git clone https://github.com/eclipse/vert.x
    cd vert.x
    mvn3 clean install
  2. In Eclipse, right click on the Package Explorer and select Import.
  3. Find the vert.x directory and import it
  4. There will be errors. In the Package Explorer, right click on the vert-core icon and select Build Path -> Configure Build Path.
  5. Select Source -> Add Folder.
  6. Find the target -> generated-test-sources -> test-annotations directory, check the box next to and click ok
  7. The vertx-core project should now build.

How to use a different version of Vert.x Under Eclipse

After building our own custom version of Vert.x, we would like the Ptolemy II Eclipse project to use it.

To force the ptII Eclipse project to use our Vert.x

  1. Right click on the ptII project, select Build Path -> Configure Build Path
  2. In the Projects tab, click add and then add the vertx-core project
  3. If you really want to be sure that we are not using the vertx-core checked in to $PTII/lib, then click on the libraries tab and remove vertx-core-3.1.0.jar. The version number and name of the jar might change.

Note that the vertx-core directory has some jar files that are probably only rebuilt when mvn3 install is run. The jar files are:

  • target/vertx-core-3.2.0-SNAPSHOT-sources.jar
  • target/vertx-core-3.2.0-SNAPSHOT-test-sources.jar
  • target/vertx-core-3.2.0-SNAPSHOT-tests.jar
  • target/vertx-core-3.2.0-SNAPSHOT.jar

So, be careful about including those in your path.

For a debug configuration, it might be helpful to add the /vertx-core/target/ directory to the classpath so that you are certain that the vertx-core .class files are included

  1. In the ptII project, click on Run -> Debug Configurations
  2. If you have not yet done so, set the main class to ptolemy.vergil.VergilApplication
  3. In the Classpath tab click on User Entries and then Advanced...
  4. In the Advanced window, click on Add Folders and then OK
  5. In the Folder Selection Window, select vertx-core -> target -> classes. Then hit ok
  6. In the Debug Configurations window, click on the newly created classes tab and then click on up and move it above "ptII(default classpath)

Failed attempt

Below did not work for me.

The https://github.com/eclipse/vert.x repo has a pom.xml file.

Running

yields a .project file that can be imported as an Eclipse project, however, it fails
(:source lang="bash":)
DeploymentOptionsConverter cannot be resolved   DeploymentOptions.java  /vertx-core/src/main/java/io/vertx/core line 86 Java Problem
VertxOptionsConverter cannot be resolved        VertxOptions.java       /vertx-core/src/main/java/io/vertx/core line 181        Java Problem
ArgumentConverter cannot be resolved    Argument.java   /vertx-core/src/main/java/io/vertx/core/cli     line 106        Java Problem
...

Right clicking on the vertx-core project, selecting Build Path->Configure Build Path and then adding src/main/generated fixed 20 errors

Next, this was missing

  import io.vertx.test.codegen.ChildInheritingDataObjectConverter;
git clone https://github.com/vert-x3/vertx-codegen.git
cd vertx-codegen
mvn3 compile
mvn3 eclipse:eclipse

Then import the vertx-codegen project.

I continued along here and ended up getting circular references between vertx-core and vertx-codegen.


Edit - History - Print - Recent Changes - Search
Page last modified on November 06, 2015, at 04:13 pm