Over the last couple of weeks I worked on a new importer for Java code that can be used for Moose, and I am happy to announce that I released version 1.0.1.
jdt2famix is an open-source project, and the repository can be on Github. It is implemented in Java as a standalone project, and it is based on JDT Core (developed as part of the Eclipse project and available under the EPL2 license) and Fame for Java (originally developed by Adrian Kuhn and is available under the LGPL license).
The current implementation has an extensive coverage of entities that it can import, namely:
The simplest way to use it is through the command line:
The result will be an MSE file having the same name as the name of the folder from which you executed the command (e.g.,
Let’s look at a concrete example. For this purpose, we pick the Maven project. We first download the 3.3.9 sources. These are only the plain sources, but to be able to import the complete model, we also need to have the dependencies available in the same folder.
As Maven is a Maven project (no pun intended), we can use the configuration to download the dependencies locally:
mvn dependency:copy-dependencies -DoutputDirectory=dependencies -DoverWriteSnapshots=true -DoverWriteReleases=false
(If you do not have a Maven project, you have to adapt this step and obtain the dependencies depending on the specifics of your project)
Then we simply execute:
And we get a
maven-3.3.9.mse file that we can load into Moose.