6.1.3.  Importing Java Modules from Maven POM File

Sonargraph supports importing content from projects based on versions 2 and 3 of Maven. Select the wizard at "File""New""Module""Java Modules from Maven POM file"

Importing Java Maven Modules
Figure 6.3. Importing Java Maven Modules

Select the Maven POM file you want to use as source for the modules of the new project. You can optionally choose to import test code referenced by the POM file and include modules defined for Maven profiles.

Sonargraph reads the global Maven settings file from ${M2_HOME}/conf/settings.xml. If ${M2_HOME} does not exist the configuration is read from ${maven.home}/conf/settings.xml.

M2_HOME or maven.home is an environment variable referencing the local Maven installation directory.

M2_HOME or maven.home must be set before Sonargraph is started.

Sonargraph reads the user specific Maven settings file from ${user.home}/.m2/settings.xml

user.home is a system property already set by the JVM to the home directory of the user.

See Online Maven Settings Reference for more details.


Changes to the configuration of the global and user settings.xml are persisted in your user preferences. Clearing the paths is not persisted.

You can decide to remove both the global and user settings.xml for the import if all required information is contained in the imported Maven POM.


If your Maven build uses Tycho, this importer tries to get source and class directories from build.properties files.