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:
- Download and build the vert.x repo
git clone https://github.com/eclipse/vert.x
cd vert.x
mvn3 clean install
- In Eclipse, right click on the Package Explorer and select Import.
- Find the vert.x directory and import it
- There will be errors. In the Package Explorer, right click on the vert-core icon and select Build Path -> Configure Build Path.
- Select Source -> Add Folder.
- Find the target -> generated-test-sources -> test-annotations directory, check the box next to and click ok
- 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
- Right click on the ptII project, select Build Path -> Configure Build Path
- In the Projects tab, click add and then add the
vertx-core
project
- 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
- In the ptII project, click on Run -> Debug Configurations
- If you have not yet done so, set the main class to
ptolemy.vergil.VergilApplication
- In the Classpath tab click on User Entries and then Advanced...
- In the Advanced window, click on Add Folders and then OK
- In the Folder Selection Window, select vertx-core -> target -> classes. Then hit ok
- 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.