Skip to content

Common params for all plug in mojos

Igor Maznitsa edited this page Apr 16, 2019 · 3 revisions

The Parameters listed below are defined for all mojos (tasks) of the plug-in.

useMavenProxy

Flag to use active proxy settings defined in settings.xml of maven. The Proxy will be used only to load SDK list and needed SDK. The Default value is true (since 2.2.0)

<useMavenProxy>false</useMavenProxy>

proxy

Allows to define proxy server parameters just in the pom.xml, they similar to proxy settings in settings.xml (but there are not id and active parameters). The Proxy server will be used for requests for SDK list and SDK downloading.

<proxy>
  <host>someproxy.com</host>
  <port>8080</port>
  <protocol>http</protocol>
  <username>me</username>
  <password>secretword</password>
  <nonProxyHosts>127.0.0.1|localhost</nonProxyHosts>
</proxy>

ignoreErrorExitCode

The Flag allows to ignore error situation in Golang tool execution (it returns non-zero value). If the flag is true then processing of command will be successful even if the Golang tool returned non-zero. Sometime it is useful to not intercept maven build process. The Default value is false

<ignoreErrorExitCode>true</ignoreErrorExitCode>

reportsFolder

Since 2.1.1 the plugin can save Golang tool terminal output as reports and the parameter allows to define place for the files. The default value is ${project.build.directory}/reports

<reportsFolder>some/special/folder_for_logs</reportsFolder>

outLogFile

Name of the report file to save console output log of the called Golang tool. By default the value is empty and in the case the log will not be saved.

<outLogFile>consoleOut.log</outLogFile>

errLogFile

Name of the report file to save console error log of the called Golang tool. By default the value is empty and in the case the log will not be saved.

<errLogFile>consoleErr.log</errLogFile>

sdkSite

The Link to the web site where list of SDK can be found, the default value is https://storage.googleapis.com/golang/, the SDK ist must be in XML format and formatted as ListBucketResult.

<sdkSite>https://127.0.0.1/sdkList</sdkSite>

hideBanner

Flag to hide or show the title banner of the plugin, sometime it is useful for fast search of the plugin log part in common log files. By default it is turned off and has true value.

<hideBanner>false</hideBanner>

storeFolder

The Root folder which will be used by the plug-in to keep unpacked SDK and packets to build Golang projects. The Default value is ${user.home}/.mvnGoLang.

<storeFolder>/home/user/mvngolang_tmp</storeFolder>

goPath

The Folder to be used as $GOPATH for project. The Default value is ${user.home}/.mvnGoLang/.go_path. As you see it is inside store folder by default.

<goPath>/home/user/.gopath</goPath>

targetArm

Value to be provided as $GOARM environment value for Golang tool. By default it is not defined.

<targetArm>5</targetArm>

goBin

Vaue to be provided as $GOBIN environment value for Golang tool. By default it is ${project.build.directory}

<goBin>/home/folder/bin</goBin>

goVersion

The Version of required Golang SDK. Since 2.2.0 it can be defined through property mvn.golang.go.version.

<goVersion>1.10.2</goVersion>

goRoot

The Value allows to define already installed Golang SDK root and in the case the plug-in will not be loading SDK from the SDK site. By default it is undefined.

<goRoot>/home/user/golangSDK/1.7</goRoot>

goRootBootstrap

The Value allows to define $GOROOT_BOOTSTRAP environment variable for starting Golang tool. By default it is undefined.

<goRootBootstrap>/home/user/gobootstrap</goRootBootstrap>

goCache

Define $GOCACHE environment variable, should provide path to a folder which will be used as a cache folder during GoLang build process, can be turned off by value off but it is disabled to turn it off in GoLang 1.12+.

<goCache>${basedir}/.gocache</goCache>

execSubpath

Sub-path to executable file in SDK folder. By default it is bin

<execSubpath>bin/other</execSubpath>

exec

The Executable file name. The Default value is go. Extension will be automatically added for recognized OS.

<exec>go2</exec>

echo

List of string to be printed before execution into log as INFO.

<echo>
  <info>Hello World</info>
  <info>He he he!</info>
<echo>

echoWarn

List of string to be printed before execution into log as WARNING.

<echoWarn>
  <warn>Too long operation!</warn>
  <warn>Needs too much resources!</warn>
</echoWarn>

disableSdkLoad

Direct order to disable SDK loading if it is not found in cache. Default value is false

<disableSdkLoad>true</disableSdkLoad>

targetOs

Value to be provided for Golang process as environment variable $GOOS. Be default is not defined.

<targetOs>linux</targetOs>

targetArch

Value to be provided for Golang process as environment variable $GOARCH. Be default is not defined.

<targetArch>linux</targetArch>

os

Allows to define OS name part for SDK archive. If undefined then plugin will try to recognize OS automatically

<os>freebsd</os>

osxVersion

Name part of Golang SDK archive to define OSX version. By default is undefined.

<osxVersion>10.2</osxVerson>

buildFlags

List of string which will be provided to Golang tool as buld flags section.

<buildFlags>
  <flag>-i</flag>
  <flag>-c</flag>
</buildFlags>

verbose

Flag to make information provided by the plug-in in log more verbose. by default is false.

<verbose>true</verbose>

keepSdkArchive

Flag to disable deleting SDK archive after loading. By default is false.

<keepSdkArchive>true</keepSdkArchive>

useGoTool

Name of tool to be called instead of standard go tool. by default is undefined.

<useGoTool>someCustomTool<useGoTool>

useEnvVars

By default the plug-in doesn't make any import from already defined environment variables like $GOOS or $GOARCH. the Flag allows to turn on import of the values if they are presented. It will be working for $GOPATH, $GOARM, $GOOS, $GOARCH, $GOBIN

<useEnvVars>true</useEnvVars>

env

List of environment variables to be provided for Golang process.

<env>
  <PATH>/home/user/somepath</PATH>
  <VAR1>some_value</VAR1>
  <GOARM>7</GOARM>
</env>

sdkArchiveName

The Parameter allows to provide full archive name for GoLang SDK instead auto-syntheses.

<sdkArchiveName>special-sdk-1.9.zip</sdkArchiveName>

sdkDownloadUrl

Parameter allows to define direct link to load SDK instead of search in provided SDK list.

<sdkDownloadUrl>https://sdkurl.com/sdk.zip</sdkDownloadUrl>

keepUnarchFolderIfError

Flag allows to disable deleting of the SDK unpacked folder if there were some error in process. by default is false.

<keepUnarchFolderIfError>true</keepUnarchFolderIfError>

addToGoPath

List of paths to be included into $GOPATH

<addToGoPath>
  <path>/home/user/one</path>
  <path>/home/user/two</path>
</addToGoPath>