Logo

4.3.1 Importing Java using the VerveineJ external parser

VerveineJ is a commercial MSE exporter built by synectique. It is a Java application based on JDT and it is available from the command line.

Here are the simple steps to take:

  1. Go to the root folder of your Java project (the one that includes all sources)
  2. Run the script to produce the MSE file: verveinej.sh .
  3. Import the output.mse file into Moose (see Section 4.1)

The complete command line options for running VerveineJ take the following form:

verveinej.sh [ <jvm-options> -- ] [ <verveine-options> ] <java-source>

A useful option is the one that provides VerveineJ with more memory. For example, to allocate 2GB we can make use of the following incantation:

/PATH_TO_verveine.extractor.java/verveinej.sh -Xmx2000m -- .

This tells the extractor that we need the Java virtual machine to allocate 2GB, and to parse sources from the current directory.

What follows after are the VerveineJ specific options. The mandatory option is the source path specification. For example, in the above statement the path was ".". Besides the source path, it is also best to specify the complete Java classpath that should be considered when parsing the sources. This classpath should include all the libraries that are being used by the system. There are two ways to specify it:

  • cp A_CLASSPATH enumerates a classpath explicitly;
  • autocp A_ROOT_FOLDER tells the parser that it should collect all jars recursively starting from the specified source path. This is useful in the case of projects that provide the library jars in sub-directories.

For example, to use both all jars from a $LIB_FOLDER, and also those specified in a LOCALCLASSPATH variable, we can use:

/PATH_TO_verveine.extractor.java/verveinej.sh -- -autocp . -cp $LOCALCLASSPATH .

To put it all together, a typical execution is to tell VerveineJ to use extra memory using the Java VM -Xmx parameter, and to take into consideration all the libs from the current project. To do this, we specify to recursively load all jars starting from the current folder using autocp:

/PATH_TO_verveine.extractor.java/verveinej.sh -Xmx2000m -- -autocp . .

The exported MSE model only contains the pointer to the source code, but not the actual source. Thus, when loading into Moose, you need to tell Moose where the root folder is (see Section 4.5). To get it working properly with Moose, the path should always be specified in a relative fashion. This is achieved by running VerveineJ from the root folder that needs to be analyzed, and by specifying the path as ".".

If you are interested, you can obtain the sources and compile the application as follows:

  1. Checkout the sources: svn checkout svn://scm.gforge.inria.fr/svn/verveinej
  2. Go to the verveine.extractor.java folder and build the jar: ant jar

User Contributed Notes

damien.cassou (20 February 2015, 2:08 pm)

https://gforge.inria.fr/projects/verveinej

tacianosilva (30 October 2014, 8:12 pm)

I too would like to use the Java parser but they are still with problems.

 

1. The link is broken: http://www.moosetechnology.org/tools/verveinej

2. The svn repo is not available: svn://scm.gforge.inria.fr/svn/verveinej

 

Where we can do the download?

stefan.zeller (28 September 2014, 8:00 pm)

I would like to parse java to MSE. But here are two issues.

 

1. The link is broken: http://www.moosetechnology.org/tools/verveinej

2. The svn repo is not available: svn://scm.gforge.inria.fr/svn/verveinej

 

Has anybody a hint about that?

rafatals3ode (11 March 2012, 2:00 pm)

please you can send to me the link to download VerveineJ.bat

tudor (11 March 2012, 1:14 pm)

Just use VerveineJ.bat

rafatals3ode (10 March 2012, 11:01 am)

how i can open the file verveinej.sh

 

i am using windows XP

a.serebrenik (29 January 2012, 4:55 pm)

Probably I'm doing something wrong...

 

C:\Users\aserebre\Desktop\ArgoUML-0-28-1\ArgoUML-0-28-1\src\argouml\src>C:\Users\aserebre\Desktop\verveine.extractor.java\verveine.extractor.java\verveinej.sh .

 

Welcome to Git (version 1.7.7-preview20111014)

 

 

Run 'git help git' to display the help index.

Run 'git help <command>' to display help for specific commands.

./lib/*.jar

Error: Could not find or load main class fr.inria.verveine.extractor.java.VerveineJParser

tudor (14 May 2011, 10:18 am)

Thanks for the suggestions. I updated the instructions.

diegof79 (12 May 2011, 7:30 pm)

The usage of verveinej.sh is:

verveinej.sh [ <jvm-options> -- ] [ <verveine-options> ] <java-source>

 

So to increase the heap size use:

./verveinej.sh -Xmx2000m -- YOUR_PATH

diegof79 (12 May 2011, 7:18 pm)

The SVN url "svn+ssh:/scm.gforge.inria.fr/svn/verveinej" doesn't work for me.

 

For information on how to checkout verveinej see this page: http://www.moosetechnology.org/tools/verveinej

Add a Note