Skip to content
Thomas Struller-Baumann edited this page Jan 30, 2023 · 95 revisions

Welcome to the visualee wiki.

Quickstart - visualee for the impatient

A video about visualee from Adam Bien.

An example graph of the opensource project <a


What is visualee?

Visualee is a maven plugin to visualize the cdi- and jpa-dependencies of a java ee project.

It addresses questions like:

  • How could i get an overview of a java ee project?
  • Who fires events and who is observing it?
  • How could i visualize JPA-Relations?
  • Who is producing classes and where are they injected?
  • Which resources are injected?
  • ...

How to include visualee in your mavenproject

visualee is available on maven central. Add this to your pom:

         <plugin>
            <groupId>de.struller-baumann</groupId>
            <artifactId>visualee</artifactId>
            <version>0.28</version>
            <configuration>
               <outputdirectory>visualee</outputdirectory>
            </configuration>
            <executions>
               <execution>
                  <phase>process-resources</phase>
                  <goals>
                     <goal>visualize</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>

To use SNAPSHOT-Versions you must also include this into your POM:

   <pluginRepositories>
      <pluginRepository>
         <id>sonatype.snapshots</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      </pluginRepository>
   </pluginRepositories>

How to use visualee

After including visualee in your pom, simply build your project. The visualization will be generated in a project outputdirectory called "visualee". In the log should be something like:

[visualee:visualize]
#######################################################
### VisualEE-Plugin
### Analyzing sourcefolder: /[your project path]
### Generating graphs
### Done, visualization can be found in
### /[your project path]/visualee/index.html
#######################################################

Open the generated index.html in your browser and select one of the generated graphs. In the index.html is a quick help (click to open it) about using the GUI.

It's recommended to use the google chrome browser, due to it's javascript performance and HTML5-capabilities. It's only tested with chrome version >= 28.0.1500.71 and firefox version >= 22.


FAQ

There are no classes displayed

Ensure that the browser could open local files (e.g. for chrome „google-chrome %U –allow-file-access-from-files“). Or serve the visualee-folder via http (e.g. python -m SimpleHTTPServer or (since Python3+) python -m http.server 8000).

How to configure the graphs

It is possible to configure the graphs individually. The attributes are:

  • distance
  • gravity
  • graphwidth
  • graphheight
  • fontsize (in percent)

The graph-name is the name of the generated files.

  • default => the default-configuration for all graphs
  • graphOnlyCDIJPA
  • graphAllClasses
  • graphEventObserverClasses
  • graphEJBClasses
  • graphInstanceClasses
  • graphInjectClasses
  • graphProducesClasses
  • graphInstanceProducesClasses
  • graphConnectedInjectProducesClasses
  • graphConnectedInjectInstanceProducesClasses
  • graphConnectedInstanceProducesClasses
  • graphResourcesClasses
  • graphJPAClasses

Example plugin-definition/configuration:

      <plugin>
        <groupId>de.struller-baumann</groupId>
        <artifactId>visualee</artifactId>
        <version>0.28</version>
        <configuration>
           <outputdirectory>visualee</outputdirectory>
           <graphs>
              <graph>
                 <name>default</name>
                 <distance>180</distance>
                 <gravity>20</gravity>
                 <graphwidth>800</graphwidth>
                 <graphheight>500</graphheight>
                 <fontsize>90</fontsize>
              </graph>
              <graph>
                 <name>graphInjectClasses</name>
                 <distance>200</distance>
                 <gravity>20</gravity>
                 <graphwidth>1200</graphwidth>
                 <fontsize>110</fontsize>
              </graph>
              <graph>
                 <name>graphEJBClasses</name>
                 <distance>300</distance>
                 <gravity>30</gravity>
              </graph>
           </graphs>
        </configuration>
        <executions>
           <execution>
              <phase>process-resources</phase>
              <goals>
                 <goal>visualize</goal>
              </goals>
           </execution>
        </executions>
     </plugin>

Configure encoding (since 0.27-SNAPSHOT available)

     ...
     <configuration>
          ...
          <encoding>UTF-16</encoding> <!-- optional, default encoding is UTF-8 -->
          ...
     </configuration>
     ...

Filter sources (since 0.27-SNAPSHOT available)

It's possible to filter classes by classname, packagename or sourcecode. The filterToken is not casesensitive. Example: You don't want to have the testclasses of your project in the graph.

     ...
     <configuration>
          ...
          <filters>
                  <!-- Example class filter, filters by classname -->
                  <filter>
                     <type>class</type>
                     <filterToken>Logger</filterToken>
                     <exclude>false</exclude>   <!-- exclude is optional, default is true -->
                  </filter>

                  <!-- Example package filter, filters by packagename -->
                  <filter>
                     <type>package</type>
                     <filterToken>test</filterToken>
                  </filter>

                  <!-- Example source filter, filters by sourcecode -->
                  <filter>
                     <type>source</type>
                     <filterToken>return null;</filterToken>
                  </filter>

          </filters>
          ...
     </configuration>
     ...

Questions, comments, ideas?

Don't hesitate to contact me: mailto:visualee@struller-baumann.de