Difference between revisions of "MVN Plugin"

From Lingoport Wiki
Jump to: navigation, search
(Created page with "Globalyzer has a number of clients: The Workbench, the command line interface, Lite, the Ant client, and the MVN plugin. When using a MVN project, you can add code scanning wi...")
 
 
(43 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
Globalyzer has a number of clients: The Workbench, the command line interface, Lite, the Ant client, and the MVN plugin. When using a MVN project, you can add code scanning with Globalyzer using our MVN plugin.
 
Globalyzer has a number of clients: The Workbench, the command line interface, Lite, the Ant client, and the MVN plugin. When using a MVN project, you can add code scanning with Globalyzer using our MVN plugin.
It is well suited for use within automation routines and Continuous Integration (CI) systems as well as within a typical developer environment, for instance within an Integrated Development Environments (IDEs).
+
It is well suited for use within automation routines and Continuous Integration (CI) systems as well as within a typical developer environment, for instance within Integrated Development Environments (IDEs).
   
The Globalyzer MVN plugin generates scan reports to a directory specified the pom.xml file. Scan reports are available in a variety of formats. We ask our MVN customers to install the MVN plugin in a private MVN repository for that company.
+
The Globalyzer MVN plugin generates scan reports to a directory specified in the pom.xml file. Scan reports are available in a variety of formats. We ask our MVN customers to install the MVN plugin in a private MVN repository for that company.
   
  +
The steps to use the Globalyzer MVN plugin are the same as any MVN plugin:
  +
* Install the plugin
  +
* Configure the pom.xml
  +
* Run MVN
   
== Using Globalyzer Lite from an Integrated Development Environment ==
 
   
  +
== Install the Globalyzer MVN Plugin ==
Lite may be used within many IDEs that support external tools, including Visual Studio, IntelliJ IDEA, and Eclipse. Configuring Lite as an external tool takes some initial setup, but is relatively easy to accomplish. Once configured, Lite may be used through the IDE's external tool menu, with the click of a button. The recommended, documented tools:
 
   
  +
The MVN plugin can be downloaded from the Client Download Page on the Globalyzer Server.
# Scan the currently selected file/directory.
 
  +
The file name is globalyzer-maven-plugin-x.y.z_#.jar where x.y.z_# is the version (including build number) for the plugin, for instance 6.1.0_22. We ask that this jar file be installed in a private MVN repository at the customer's site.
# Scan everything within the parent directory of the currently selected file/directory.
 
# Scan the entire project.
 
   
  +
For example, a developer who wants to install the plugin in their local .m2 repository can use the following installation command, provided for version <code>6.1.0</code> of the MVN plugin. The same applies to other versions.
Demonstration videos are available for:
 
   
  +
C:\Users\Yourname>'''mvn install:install-file''' -Dfile="C:/Path/to/the/plugin/jarfile/'''globalyzer-maven-plugin-6.1.0_22.jar'''" -DgroupId='''com.lingoport.globalyzer.client.maven''' -DartifactId='''globalyzer-maven-plugin''' -Dversion='''6.1.0''' -Dpackaging='''maven-plugin'''
* [https://player.vimeo.com/video/137641243 Visual Studio]
 
  +
[INFO] Scanning for projects...
* [https://player.vimeo.com/video/137641242 IntelliJ IDEA]
 
  +
[INFO]
* [https://player.vimeo.com/video/137641241 Eclipse]
 
  +
[INFO] ------------------------------------------------------------------------
  +
[INFO] Building Maven Stub Project (No POM) 1
  +
[INFO] ------------------------------------------------------------------------
  +
[INFO]
  +
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
  +
[INFO] Installing C:\Linternal\Installers\install\globalyzer-maven-plugin-6.1.0_22.jar to C:\Users\Yourname\.m2\repository\com\lingoport\globalyzer\client\maven\globalyzer-maven-plugin\6.1.0\globalyzer-maven-plugin-6.1.0_22.jar
  +
[INFO] ------------------------------------------------------------------------
  +
[INFO] BUILD SUCCESS
  +
[INFO] ------------------------------------------------------------------------
  +
[INFO] Total time: 0.615 s
  +
[INFO] Finished at: 2016-09-09T15:49:59-06:00
  +
[INFO] Final Memory: 7M/123M
  +
[INFO] ------------------------------------------------------------------------
   
  +
== Configure the Globalyzer MVN Plugin ==
The developer can then use the power of the IDE to refactor the relevant issues or to mark false positives in the code using Globalyzer ignore comments, such as $NON-NLS-L$. For more information, see the Globalyzer Comment Tags in [[ False Positives | False Positives ]] .
 
  +
The <code><build><plugins></code> section of your module's pom.xml file must be configured. Here is how:
   
  +
<plugin>
Those refactoring and the comment tags are now part of the code: The Continuous Globalization System using the same Lite project definition file will show the same results in the Dashboard.
 
  +
<groupId>com.lingoport.globalyzer.client.maven</groupId>
  +
<artifactId>globalyzer-maven-plugin</artifactId>
  +
<version>6.1.0</version>
  +
<configuration>
  +
'''-required - '''
  +
'''- session level settings - '''
  +
<username>joe@company.com</username>
  +
<password>joespw</password>
  +
'''- scan level settings - '''
  +
<ruleSetName>Java Rule Set</ruleSetName>
  +
'''-optional -'''
  +
'''- session level settings -'''
  +
<serverUrl></serverUrl> (default: https://www.globalyzer.com/gzserver)
  +
<dataDictionaryDir></dataDictionaryDir> ( default: userhome/.globalyzer )
  +
<scanTimeout></scanTimeout> ( default: 120 seconds )
  +
<filterWithDictionary></filterWithDictionary> ( default: true )
  +
<setLog4jProperties></setLog4jProperties> ( default: true )
  +
<log4jPropertiesFileDir></log4jPropertiesFileDir> ( default: Globalyzer provided )
  +
<enhancedScanning></enhancedScanning> ( default: true )
  +
<clearCache></clearCache> ( default: false )
  +
'''- scan level settings -'''
  +
<projectName></projectName> ( default: project artifact )
  +
<projectDir></projectDir> ( default: project src/main/java )
  +
<ruleSetOwner></ruleSetOwner> ( default: username )
  +
<scanName></scanName> ( default: auto-generate )
  +
<!-- choices: -->
  +
<!-- ScanDetailedXML -->
  +
<!-- ScanDetailedExcel -->
  +
<!-- ScanDetailedCSV -->
  +
<!-- ScanSummaryHtml -->
  +
<!-- ScanSummaryText -->
  +
<reportType></reportType> ( default: ScanDetailedXML )
  +
<reportPath></reportPath> ( default: target/i18n )
  +
</configuration>
  +
</plugin>
   
  +
Notes:
== Using Globalyzer Lite in a Continuous Globalization System ==
 
  +
* The <b><code>session level settings </code></b> are set once per MVN invocation. Whichever scan / project goal is executed first, its configuration will be set for all the subsequent scans
  +
* The <code>log4jPropertiesFileDir</code> is precisely that: which log4j <b>configuration</b> file to use if <code>setLog4jProperties</code> is set to true. For example, if that setting points to <code>/path/to/log4j.properties</code> and in that configuration, the appender points to <code>/path/to/globalyzer/log</code>, that's where the logs will be written out.
  +
* Best would be to have the <b>exact same configuration</b> for all Globalyzer goals to make sure one configuration is not taking over the other ones.
  +
* By default, <code>enhancedScanning</code> takes place. However, this detailed scanning takes a lot of memory. If you find that you are running out of memory when scanning, try setting this to false.
  +
* By default, <code>clearCache</code> is set to false. This attribute only makes sense if <code>enhancedScanning</code> is set to true. It's a way to try to reduce the amount of memory used when performing detailed scanning.
   
Globalyzer Lite is easy to integrate into Continuous Integration (CI) systems. For instance, using Lite from Jenkins can be done through the following steps:
 
   
  +
== Running Globalyzer MVN Plugin From The Command Prompt / Shell ==
# Check in a project definition file into source control (or, if you prefer, place one in the Jenkins server's filesystem).
 
# Run the following from Jenkins' shell:
 
#:<code>java -jar globalyzer-lite.jar -f "${WORKSPACE}/GlobalyzerProjectDefinitionFile.xml" --project-path "${WORKSPACE}" --report-path "globalyzer-lite-reports"</code>
 
# Use the Lingoport Dashboard to display the results from the generated reports.
 
   
  +
Globalyzer MVN Plugin can be executed from a command prompt or shell via the following command:
You may also pass the reports to your own reporting system.
 
   
  +
<code>mvn com.lingoport.globalyzer.client.maven:globalyzer-maven-plugin:6.1.0:scan</code>
== Using Globalyzer Lite from the Command Prompt / Shell ==
 
   
  +
After MVN finishes each scan, a Globalyzer report per scan is created at the location specified in the pom.xml report path. The default location for the reports are target/i18n for each MVN module.
Globalyzer Lite can be executed from a command prompt or shell via the following command:
 
   
<code>java -jar globalyzer-lite.jar some_location/YourProjectDefinitionFile.xml</code>
 
   
  +
If you have configured the execution to be in the <code>validate</code> phase, you can run the simpler command:
After lite finishes each scan, a relevant Globalyzer report is created at the location specified in the Project Definition's report path.
 
   
  +
<code>mvn validate</code>
Lite also allows for altering the following parameters via command line options:
 
   
  +
(See the multi-scan example below)
* The Project Path
 
* The Report Path
 
* The Files/Directories to scan
 
   
  +
== Multi-Threaded Support ==
  +
The Globalyzer MVN plugin does not support multi-threaded invocation.
   
  +
== Multi-Scan Projects ==
== Sharing Project Definition Files Between IDEs and Build Systems ==
 
   
  +
To execute more than one scan on a MVN project, use as many "execution" as you have rule sets to apply to scan the code. For instance, two scans will be performed with the following snippet, one using the <code>testjava</code> rule set, the other using the <code>testjavascript</code> rule set:
It is common to check in a single project definition file per code repository. However, the desired IDE configuration may sometimes be incompatible with the desired build system configuration.
 
   
  +
<plugin>
These incompatibilities are best solved by modifying the project definition file within the build system. The IDE config can then be used as the default.
 
  +
<groupId>com.lingoport.globalyzer.client.maven</groupId>
  +
<artifactId>globalyzer-maven-plugin</artifactId>
  +
<version>6.1.0</version>
  +
<executions>
  +
<execution>
  +
'''<id>execution1</id>
  +
<phase>validate</phase'''>
  +
<configuration>
  +
<username>bob@yourcompany.com</username>
  +
<password>bobpassword</password>
  +
'''<ruleSetName>testjava</ruleSetName>'''
  +
<scanName>java-report</scanName>
  +
</configuration>
  +
<goals>
  +
'''<goal>scan</goal>'''
  +
</goals>
  +
</execution>
  +
<execution>
  +
'''<id>execution2</id>
  +
<phase>validate</phase>'''
  +
<configuration>
  +
<username>bob@yourcompany.com</username>
  +
<password>bobpassword</password>
  +
'''<ruleSetName>testjavascript</ruleSetName>'''
  +
<scanName>javascript-report</scanName>
  +
</configuration>
  +
<goals>
  +
'''<goal>scan</goal>'''
  +
</goals>
  +
</execution>
  +
</executions>
  +
</plugin>
   
  +
== Sharing pom.xml Files Between IDEs and Build Systems ==
Here is an example: The desired report type for Lite may be ScanDetailedCSV for developer usage, but will need to be ScanDetailedXML within the build system. The project definition file would then be written out with the <report-type> set to ScanDetailedCSV:
 
<pre><gzproject>
 
...
 
<report-type>ScanDetailedCSV</report-type>
 
...
 
</gzproject></pre>
 
   
  +
It is common to check in a single <code>pom.xml</code> per code repository. However, some configuration on a developer's laptop may be different from a build system.
The build system can then be set to auto-replace "ScanDetailedCSV" with "ScanDetailedXML". The following Linux command will do so:
 
   
  +
A possibility to bridge the environment is to keep the most Globalyzer specific configuration only in the pom.xml file and to move the system side in the settings.xml file.
<code>$ sed --in-place 's|ScanDetailedCSV|ScanDetailedXML|' $WORKSPACE/ProjectDefinition.xml</code>
 
 
If desired, the opposite replacement also may be performed at the end of the build.
 
 
Finally, here is a bash function to replace the content of any XML field:
 
 
<pre>replace_xml_token() {
 
token_name=$1
 
new_content=$2
 
sed -ri "s|(<${token_name}>).*(</${token_name}>)|\1${new_content}\2|g" $WORKSPACE/ProjectDefinition.xml
 
}</pre>
 
 
It may be used like so:
 
 
<code>$ replace_xml_token "report-type" "ScanDetailedXML"</code>
 
 
== Ease of Installation ==
 
 
Installing Lite is easy. To install:
 
 
# Unzip the Globalyzer Lite zip file at a desired location
 
# Run either lite-setup.bat or lite-setup.sh depending on your system.
 
 
== Configuration & Rule Sets ==
 
 
Before use of Globalyzer Lite, rule sets will need to be configured on the Globalyzer Server. Properly configured rule sets better detect i18n issues, and cut down the rate of false positives.
 
 
A Project Definition File will then need to be created for the given project. This file may be distributed to multiple users working on the same project.
 
 
The project definition file will need to make use of the correct rule sets relevant to the project, and to specify which directories to scan with each rule set. It is recommended that this file be configured by an i18n knowledgeable developer or i18n specialist.
 
 
== Project Definition Format==
 
 
Here is the template for a project definition file. For the full instructions to setup a project definition file, see our
 
[https://www.globalyzer.com/gzserver/help/referenceLite/project-definition-file-overview.html help page].
 
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
&lt;!-- All items should be allowed anywhere in the xml as long as the hierarchy
 
is preserved -->
 
<gzproject>
 
<login>
 
<username></username>
 
<password></password>
 
<server></server>
 
&lt;!-- Optional Parameters --&gt;
 
<optional>
 
<proxy-user></proxy-user>
 
<proxy-password></proxy-password>
 
<proxy-host></proxy-host>
 
<proxy-port></proxy-port>
 
<optional>
 
</login>
 
<project-path></project-path> &lt;!-- May instead be specified from command line --&gt;
 
<project-name></project-name>
 
<report-path></report-path> &lt;!-- May instead be specified from command line --&gt;
 
<report-type></report-type>
 
<scans>
 
<scan>
 
&lt;!-- create and execute a single scan with this info -->
 
<scan-name></scan-name>
 
<ruleset-name></ruleset-name>
 
<ruleset-owner></ruleset-owner>
 
</scan>
 
<scan>
 
&lt;!-- create and execute a single scan with this info -->
 
<scan-name></scan-name>
 
<ruleset-name></ruleset-name>
 
<ruleset-owner></ruleset-owner>
 
&lt;!-- optional: specify files/directories to scan -->
 
<scan-items>
 
<item></item>
 
<item></item>
 
</scan-items>
 
</scan>
 
</scans>
 
</gzproject>
 
 
== The .globalyzerrc File ==
 
 
Globalyzer Lite supports an optional .globalyzerrc file. This file may be used to specify login, server, and proxy parameters. Below is an example .globalyzerrc file. It contains all parameters that may be set within the rc file:
 
 
<pre>server https://www.globalyzer.com/gzserver
 
 
username user@company.com
 
password aPasswordHere
 
 
proxy-host https://internalhost.company.com
 
proxy-port 81038
 
proxy-user ExampleUser
 
proxy-password ExamplePassword</pre>
 
 
All settings besides 'server' are optional. And project definition files do not need to specify parameters set in the rc file (with one exception). Any parameter that is set in the project definition file will override the rc file setting.
 
 
If you choose to use a .globalyzerrc, the 'server' parameter is mandatory. It must match the server specified in project definition files. This helps prevent rule sets from being retrieved from the wrong server.
 
 
== Setting Proxy Settings via Java ==
 
 
If you prefer to specify proxy settings via Java, rather than through the project definition file, you may use any of the following Java settings.
 
 
-Dhttp.proxyHost=your.server.com
 
-Dhttp.proxyPort=80
 
-Dhttps.proxyHost=your.server.com
 
-Dhttps.proxyPort=80
 
-Dhttp.nonProxyHosts=123.210.123.210
 
-DsocksProxyHost=your.server.com
 
-DsocksProxyPort=1080
 
 
More info at: https://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
 
 
== Exit Error Codes ==
 
{| style="text-align: left;"
 
|- style="font-size: 125%;"
 
! colspan="2" | Type
 
|-
 
! Name !! style="padding-left: 15px;" | Exit Code
 
|-
 
| ||
 
 
|- style="font-size: 125%;"
 
! colspan="2" | Normal
 
|-
 
| EXIT_NORMAL || style="padding-left: 15px;" | 0
 
|-
 
| ||
 
 
|- style="font-size: 125%;"
 
! colspan="2" |XML Issues
 
|-
 
|NO_PATH_TO_XML_FILE || style="padding-left: 15px;" | 10
 
|-
 
| DUPLICATE_PARAMETER_IN_XML || style="padding-left: 15px;" | 11
 
|-
 
| XML_PARAMETER_BLANK || style="padding-left: 15px;" | 12
 
|-
 
| XML_INVALID_PARAMETER || style="padding-left: 15px;" | 13
 
|-
 
| UNABLE_TO_READ_SCHEMA || style="padding-left: 15px;" | 14
 
|-
 
| ||
 
 
|- style="font-size: 125%;"
 
! colspan="2" | Globalyzer API compatibility
 
|-
 
| GLOBALYZER_API_REPORT_TYPE_NOT_MATCHED || style="padding-left: 15px;" | 30
 
|-
 
| GLOBALYZER_API_EXCEPTION || style="padding-left: 15px;" | 31
 
|- style="height:20px"
 
|-
 
| ||
 
 
|- style="font-size: 125%;"
 
! colspan="2" | Input issues
 
|-
 
| IMPROPER_INPUT || style="padding-left: 15px;" | 51
 
|-
 
| INVALID_COMMANDS || style="padding-left: 15px;" | 52
 
|-
 
| PROJECT_PATH_DOES_NOT_EXIST || style="padding-left: 15px;" | 53
 
|-
 
| ||
 
 
|- style="font-size: 125%;"
 
! colspan="2" | Output Issues
 
|-
 
| SCAN_FAILED || style="padding-left: 15px;" | 60
 
|}
 
 
== Language Support ==
 
Globalyzer Lite supports the same languages as the full Globalyzer product. It allows users to scan a number of source code in different programming languages:
 
* ActionScript,
 
* C#,
 
* C/C++ (many variations),
 
* Delphi,
 
* HTML (in various web files),
 
* Java,
 
* JavaScript, (includes AngularJS, NodeJS, and other libraries)
 
* Objective-C,
 
* MXML,
 
* Perl,
 
* PHP,
 
* Qt,
 
* SQL (Oracle, MS SQL, MySQL, PostgreSQL),
 
* Visual Basic (Classic, .NET),
 
* VBScript, and
 
* XML
 
 
== Lite vs the Globalyzer API ==
 
 
Globalyzer Lite utilizes the Globalyzer API. Using the API directly is more powerful, but also requires writing a custom java application.
 
 
== Lite vs the Globalyzer Workbench ==
 
 
In comparison to the Globalyzer Workbench, Globalyzer Lite is smaller, faster to install and does not require a database. Lite supports direct integration with IDEs, while the Workbench is its own standalone program. Additionally, unlike the workbench, multiple instances of Lite may be run concurrently. This allows Continuous Integration systems to use Lite to provision the scanning of multiple projects.
 

Latest revision as of 23:29, 23 March 2018

Globalyzer has a number of clients: The Workbench, the command line interface, Lite, the Ant client, and the MVN plugin. When using a MVN project, you can add code scanning with Globalyzer using our MVN plugin. It is well suited for use within automation routines and Continuous Integration (CI) systems as well as within a typical developer environment, for instance within Integrated Development Environments (IDEs).

The Globalyzer MVN plugin generates scan reports to a directory specified in the pom.xml file. Scan reports are available in a variety of formats. We ask our MVN customers to install the MVN plugin in a private MVN repository for that company.

The steps to use the Globalyzer MVN plugin are the same as any MVN plugin:

  • Install the plugin
  • Configure the pom.xml
  • Run MVN


Install the Globalyzer MVN Plugin

The MVN plugin can be downloaded from the Client Download Page on the Globalyzer Server. The file name is globalyzer-maven-plugin-x.y.z_#.jar where x.y.z_# is the version (including build number) for the plugin, for instance 6.1.0_22. We ask that this jar file be installed in a private MVN repository at the customer's site.

For example, a developer who wants to install the plugin in their local .m2 repository can use the following installation command, provided for version 6.1.0 of the MVN plugin. The same applies to other versions.

 C:\Users\Yourname>mvn install:install-file -Dfile="C:/Path/to/the/plugin/jarfile/globalyzer-maven-plugin-6.1.0_22.jar" -DgroupId=com.lingoport.globalyzer.client.maven -DartifactId=globalyzer-maven-plugin -Dversion=6.1.0 -Dpackaging=maven-plugin
 [INFO] Scanning for projects...
 [INFO]
 [INFO] ------------------------------------------------------------------------
 [INFO] Building Maven Stub Project (No POM) 1
 [INFO] ------------------------------------------------------------------------
 [INFO]
 [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
 [INFO] Installing C:\Linternal\Installers\install\globalyzer-maven-plugin-6.1.0_22.jar to C:\Users\Yourname\.m2\repository\com\lingoport\globalyzer\client\maven\globalyzer-maven-plugin\6.1.0\globalyzer-maven-plugin-6.1.0_22.jar
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD SUCCESS
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 0.615 s
 [INFO] Finished at: 2016-09-09T15:49:59-06:00
 [INFO] Final Memory: 7M/123M
 [INFO] ------------------------------------------------------------------------

Configure the Globalyzer MVN Plugin

The <build><plugins> section of your module's pom.xml file must be configured. Here is how:

 <plugin>
 <groupId>com.lingoport.globalyzer.client.maven</groupId>
 <artifactId>globalyzer-maven-plugin</artifactId>
 <version>6.1.0</version>
 <configuration>
     -required - 
          - session level settings - 
          <username>joe@company.com</username>
          <password>joespw</password>
          - scan level settings - 
          <ruleSetName>Java Rule Set</ruleSetName>
     -optional -
          - session level settings -
          <serverUrl></serverUrl>  (default: https://www.globalyzer.com/gzserver)     
          <dataDictionaryDir></dataDictionaryDir>  ( default: userhome/.globalyzer )
          <scanTimeout></scanTimeout>  ( default: 120 seconds )
          <filterWithDictionary></filterWithDictionary> ( default: true )
          <setLog4jProperties></setLog4jProperties>  ( default: true )
          <log4jPropertiesFileDir></log4jPropertiesFileDir> ( default: Globalyzer provided )    
          <enhancedScanning></enhancedScanning> ( default: true )
          <clearCache></clearCache>  ( default: false )
          - scan level settings -    
          <projectName></projectName>  ( default: project artifact )    
          <projectDir></projectDir>  ( default: project src/main/java )
          <ruleSetOwner></ruleSetOwner>  ( default: username )
          <scanName></scanName>  ( default: auto-generate ) 
          <reportType></reportType>  ( default: ScanDetailedXML )
          <reportPath></reportPath>  ( default: target/i18n )        
 </configuration>
 </plugin>

Notes:

  • The session level settings are set once per MVN invocation. Whichever scan / project goal is executed first, its configuration will be set for all the subsequent scans
  • The log4jPropertiesFileDir is precisely that: which log4j configuration file to use if setLog4jProperties is set to true. For example, if that setting points to /path/to/log4j.properties and in that configuration, the appender points to /path/to/globalyzer/log, that's where the logs will be written out.
  • Best would be to have the exact same configuration for all Globalyzer goals to make sure one configuration is not taking over the other ones.
  • By default, enhancedScanning takes place. However, this detailed scanning takes a lot of memory. If you find that you are running out of memory when scanning, try setting this to false.
  • By default, clearCache is set to false. This attribute only makes sense if enhancedScanning is set to true. It's a way to try to reduce the amount of memory used when performing detailed scanning.


Running Globalyzer MVN Plugin From The Command Prompt / Shell

Globalyzer MVN Plugin can be executed from a command prompt or shell via the following command:

mvn com.lingoport.globalyzer.client.maven:globalyzer-maven-plugin:6.1.0:scan

After MVN finishes each scan, a Globalyzer report per scan is created at the location specified in the pom.xml report path. The default location for the reports are target/i18n for each MVN module.


If you have configured the execution to be in the validate phase, you can run the simpler command:

mvn validate

(See the multi-scan example below)

Multi-Threaded Support

The Globalyzer MVN plugin does not support multi-threaded invocation.

Multi-Scan Projects

To execute more than one scan on a MVN project, use as many "execution" as you have rule sets to apply to scan the code. For instance, two scans will be performed with the following snippet, one using the testjava rule set, the other using the testjavascript rule set:

 <plugin>
       <groupId>com.lingoport.globalyzer.client.maven</groupId>
       <artifactId>globalyzer-maven-plugin</artifactId>
       <version>6.1.0</version>
       <executions>
         <execution>
           <id>execution1</id>
           <phase>validate</phase>
             <configuration>
             <username>bob@yourcompany.com</username>
             <password>bobpassword</password>
             <ruleSetName>testjava</ruleSetName>
             <scanName>java-report</scanName>
             </configuration>
              <goals>
                 <goal>scan</goal>
             </goals>            
         </execution>
         <execution>
         <id>execution2</id>
          <phase>validate</phase>
           <configuration>
             <username>bob@yourcompany.com</username>
             <password>bobpassword</password>
             <ruleSetName>testjavascript</ruleSetName>
             <scanName>javascript-report</scanName>
            </configuration>
            <goals>
              <goal>scan</goal>
            </goals>
         </execution>
       </executions>                  
 </plugin>

Sharing pom.xml Files Between IDEs and Build Systems

It is common to check in a single pom.xml per code repository. However, some configuration on a developer's laptop may be different from a build system.

A possibility to bridge the environment is to keep the most Globalyzer specific configuration only in the pom.xml file and to move the system side in the settings.xml file.