Skip to content

PluginConfigParameters

Igor Maznitsa edited this page Apr 4, 2016 · 6 revisions

Configuration parameters of the mvn-golang-wrapper plugin

Common parameters

The Parameters are shared by all mojos of the plugin!

sdkSite

Allows to define site to load SDK archives, by default it has link 'https://storage.googleapis.com/golang/'. The List of SDKs must be in XML format and formatted as ListBucketResult

<sdkSite>https://storage.googleapis.com/golang/</sdkSite>

hideBanner

The Boolean flag allows to hide the ASC II banner in the log. By default the flag is false and the banner is shown.

<hideBanner>false</hideBanner>

storeFolder

It is very important value for the plugin, it contains path to the folder where the plugin will keep downloaded and unpacked SDKs and keep misc info. By default it will be created in ${user.home}/.mvnGoLang

<storeFolder>${user.home}${file.separator}.mvnGoLang</storeFolder>

goPath

The Parameter provides the GOPATH value for the plugin, by default it is defined as ${user.home}${file.separator}.mvnGoLang${file.separator}.go_path

<goPath>${user.home}${file.separator}.mvnGoLang${file.separator}.go_path</goPath>

If to enable usage of values from OS environment variables for the plugin (with useEnvVars)and there will be GOPATH then its value will be used.

goVersion

It is very important required parameter which contains version of needed GoLang SDK.

<goVersion>1.6</goVersion>

goRoot

If defined then contains path to the GoLang SDK, if SDK is downloaded and unpacked then the plugin will provide automatically path to the SDK.

<goRoot>some/sdk/go</goRoot>

goRootBootstrap

It allows to define value for $GOROOT_BOOTSTRAP variable.

<goRootBootstrap>some/sdk/go2</goRootBootstrap>

execSubpath

Sub-path to find the go tool inside SDK folder.

<execSubpath>bin</execSubpath>

exec

The Name of executable go tool application. It should not have extension, the name only!

<exec>go</exec>

echoWarn

List of messages to be printed into log as warnings.

<echoWarn>
  <log>It is Warning!!</log>
</echoWarn>

echo

List of messages to be printed into log as info.

<echo>
  <log>It is info!!</log>
</echo>

disableSdkDownload

Flag to disable automatic download of needed SDK.

<disableSdkDownload>true</disableSdkDownload>

sources

It is very important parameter because it contains the path to the GoLang application sources which should be processed. By default it has predefined path ${basedir}/src/golang

<sources>${basedir}${file.separator}src${file.separator}golang</sources>

os

The Value is used as host OS name and plugin -uses it to make synthesis of SDK distributive name.If it is not provided then plug-in will try to figure out that automatically.

<os>linux</os>

arch

The Value is used as host architecture name and plug-in uses it to make synthesis of SDK distributive name. If it is not provided then plug-in will try to figure out that automatically.

<arch>amd64</amd>

osxVersion

The Value is needed only for OSX, because SDK name for OSX contains special section with OSX version.

<osxVersion>10.4</osxVersion>

targetArch

The Value to be provided as $GOARCH variable during Go tool execution.

<targetArch>arm</targetArch>

targetOs

The Value to be provided as $GOOS variable during Go tool execution.

<targetOs>windows</targetArch>

buildFlags

List of string which will be provided as build flags during execution of Go tool.

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

verbose

The Flag allows to make log output more informative.

<verbose>true</verbose>

keepSdkArchive

The Flags allows to keep downloaded SDK archive after unpacking.

<keepSdkArchive>true</keepSdkArchive>

useGoTool

One more way to replace name of standard go tool application.

<useGoTool>golang.sh</useGoTool>

sdkArchiveName

Allows to define directly the name of SDK to be downloaded. If it is defined then SDK list will not be used for search of archive name.

<sdkArchiveName>go1.6.windows-amd64.msi</sdkArchiveName>

sdkDownloadUrl

Allows to define directly URL to download SDK archive.

<sdkDownloadUrl>https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz</sdkDownloadUrl>

findExecInGoPath

Allows to make plugin use $GOPATH as root folder instead of $GOROOT to find sub-folder where go lang tool is presented

<findExecInGoPath>true</findExecInGoPath>

useEnvVars

If the flag is true then plugin will be checking environment variables $GOROOT, $GOROOT_BOOTSTRAP, $GOOS, $GOARCH, $GOPATH and use their values if possible.

<useEnvVars>true</useEnvVars>

env

it allows to define custom environment variables for started go tool process.

<env>
   <GOSOME_PATH>/some/path/to/go</GOSOME_PATH>
   <VERSION>1.6</VERSION>
</env>

keepUnarchFolderIfError

The Flag allows to disable deleting of SDK unpacked folder if there is an error during operation. It is mainly for plug-in testing purposes.

<keepUnarchFolderIfError>true</keepUnarchFolderIfError>

Extra parameters for BUILD mojo

target

The Path to the folder where should be placed the build result file. By default it is ${project.build.directory}

<target>${project.build.directory}</target>

name

It is required parameter which should contain name of the result file.

<name>application.exe</name>

Extra parameters for GET mojo

autofixGitCache

Sometime during get operation it is possible to see error for some cached info for Git repository. The Flag allows to try to fix the state automatically with git rm -r --cached . for problematic package and restart the task.

<autofixGitCache>true</autofixGitCache>

Extra parameters for TEST mojo

testFlags

List of test binary flags to be provided to go lang tool.

<testFlags>
   <flag>-x</flag>
   <flag>-v</flag>
</testFlags>

Extra parameters for TOOL mojo

command

It contains command name.

<command>yacc</command>

args

It contains arguments for the command.

<args>
  <arg>-l</arg>
  <arg>-v</arg>
</args>