public abstract class AbstractGolangMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
buildFlagsToIgnore
set of flags to be ignored among build and extra build flags, for inside
use
|
static String |
GOARTIFACT_PACKAGING |
static String |
NAME_PATTERN
VERSION, OS, PLATFORM,-OSXVERSION
|
protected org.apache.maven.settings.Settings |
settings |
protected List<String> |
tempBuildFlags |
| Constructor and Description |
|---|
AbstractGolangMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
adaptExecNameForOS(String execName) |
protected void |
addTmpBuildFlagIfNotPresented(String... flags) |
void |
afterExecution(ProxySettings proxySettings,
boolean error) |
void |
beforeExecution(ProxySettings proxySettings) |
protected boolean |
doesNeedOneMoreAttempt(org.zeroturnaround.exec.ProcessResult result,
String consoleOut,
String consoleErr) |
void |
doInit() |
protected boolean |
doMainBusiness(ProxySettings proxySettings,
int maxAttempts) |
void |
execute() |
protected static File |
findExisting(File... files) |
File[] |
findGoPath(boolean ensureExist) |
protected File |
findGoRoot(ProxySettings proxySettings) |
File |
findGoRootBootstrap(boolean ensureExist) |
String |
getArch() |
org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver |
getArtifactResolver() |
String[] |
getBuildFlags() |
String[] |
getCommandFlags() |
int |
getConnectionTimeout() |
Map<?,?> |
getEnv() |
String |
getErrLogFile() |
String |
getExec() |
String |
getExecSubpath() |
org.apache.maven.plugin.MojoExecution |
getExecution() |
protected String[] |
getExtraBuildFlags() |
String |
getGoBin() |
String |
getGoCommand() |
String |
getGoPath() |
String |
getGoRoot() |
String |
getGoRootBootstrap() |
String |
getGoVersion() |
String[] |
getOptionalExtraTailArguments() |
String |
getOs() |
String |
getOSXVersion() |
String |
getOutLogFile() |
org.apache.maven.project.MavenProject |
getProject() |
ProxySettings |
getProxy() |
List<org.apache.maven.artifact.repository.ArtifactRepository> |
getRemoteRepositories() |
String |
getReportsFolder() |
String |
getSdkArchiveName() |
String |
getSdkDownloadUrl() |
String |
getSdkSite() |
org.apache.maven.execution.MavenSession |
getSession() |
File |
getSources(boolean ensureExist) |
protected String |
getSpecialPartOfGoPath()
Internal method which returns special part of GOPATH which can be formed by
mojos.
|
String |
getStoreFolder() |
boolean |
getSupposeSdkArchiveFileName() |
String[] |
getTailArguments() |
String |
getTarget386() |
String |
getTargetArch() |
String |
getTargetArm() |
String |
getTargetOS() |
String |
getUseGoTool() |
protected void |
initConsoleBuffers() |
boolean |
isCheckSdkHash() |
boolean |
isCommandSupportVerbose() |
boolean |
isDisableSdkLoad() |
boolean |
isDisableSslCheck() |
boolean |
isEnforceGoPathToEnd() |
boolean |
isEnforcePrintOutput() |
boolean |
isFilterEnvPath() |
boolean |
isHideBanner() |
boolean |
isIgnoreErrorExitCode() |
boolean |
isKeepSdkArchive() |
boolean |
isKeepUnarchFolderIfError() |
boolean |
isMojoMustNotBeExecuted() |
boolean |
isSkip() |
boolean |
isSourceFolderRequired() |
boolean |
isUseEnvVars() |
boolean |
isUseMavenProxy() |
boolean |
isVerbose() |
protected void |
logOptionally(String message) |
String |
makeExecutableFileSubpath() |
protected String |
makePathFromExtraGoPathElements() |
protected org.zeroturnaround.exec.ProcessExecutor |
prepareExecutor(ProxySettings proxySettings) |
protected void |
printLogs(boolean forcePrint,
boolean errorDetected,
String outLog,
String errLog) |
protected void |
processConsoleOut(int exitCode,
String out,
String err) |
protected void |
registerEnvVars(org.zeroturnaround.exec.ProcessExecutor result,
File theGoRoot,
String theGoBin,
File sourcesFile,
File[] goPathParts) |
protected void |
registerOutputBuffers(org.zeroturnaround.exec.ProcessExecutor executor) |
void |
setDisableSslCheck(boolean flag) |
public static final String GOARTIFACT_PACKAGING
public static final String NAME_PATTERN
protected final Set<String> buildFlagsToIgnore
@Parameter(defaultValue="${settings}",
readonly=true)
protected org.apache.maven.settings.Settings settings
@Nonnull public org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver getArtifactResolver()
@Nonnull @MustNotContainNull public List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
public boolean isFilterEnvPath()
public boolean isSkip()
public boolean isEnforceGoPathToEnd()
@Nonnull public org.apache.maven.project.MavenProject getProject()
@Nonnull public org.apache.maven.plugin.MojoExecution getExecution()
@Nonnull public org.apache.maven.execution.MavenSession getSession()
public boolean isIgnoreErrorExitCode()
public int getConnectionTimeout()
public boolean isUseEnvVars()
public boolean isKeepSdkArchive()
public boolean isKeepUnarchFolderIfError()
public boolean isCheckSdkHash()
public boolean isVerbose()
public boolean isDisableSdkLoad()
@Nonnull @MustNotContainNull public File[] findGoPath(boolean ensureExist) throws IOException
IOException@Nullable public File findGoRootBootstrap(boolean ensureExist) throws IOException
IOExceptionpublic boolean isUseMavenProxy()
public boolean getSupposeSdkArchiveFileName()
public boolean isDisableSslCheck()
public void setDisableSslCheck(boolean flag)
@Nullable public ProxySettings getProxy()
@Nonnull public File getSources(boolean ensureExist) throws IOException
IOExceptionprotected void addTmpBuildFlagIfNotPresented(@Nonnull @MustNotContainNull String... flags)
protected void initConsoleBuffers()
@Nonnull protected File findGoRoot(@Nullable ProxySettings proxySettings) throws IOException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionpublic boolean isHideBanner()
protected boolean doesNeedOneMoreAttempt(@Nonnull org.zeroturnaround.exec.ProcessResult result, @Nonnull String consoleOut, @Nonnull String consoleErr) throws IOException, org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected boolean doMainBusiness(@Nullable ProxySettings proxySettings, int maxAttempts) throws InterruptedException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException, IOException
InterruptedExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionIOExceptionpublic final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic void doInit()
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionpublic void beforeExecution(@Nullable ProxySettings proxySettings) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionpublic void afterExecution(@Nullable ProxySettings proxySettings, boolean error) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionpublic boolean isEnforcePrintOutput()
protected void printLogs(boolean forcePrint,
boolean errorDetected,
@Nonnull
String outLog,
@Nonnull
String errLog)
public boolean isSourceFolderRequired()
public boolean isMojoMustNotBeExecuted()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException@Nonnull @MustNotContainNull public String[] getOptionalExtraTailArguments()
@Nullable protected org.zeroturnaround.exec.ProcessExecutor prepareExecutor(@Nullable ProxySettings proxySettings) throws IOException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected void registerOutputBuffers(@Nonnull org.zeroturnaround.exec.ProcessExecutor executor)
protected void registerEnvVars(@Nonnull org.zeroturnaround.exec.ProcessExecutor result, @Nonnull File theGoRoot, @Nullable String theGoBin, @Nonnull File sourcesFile, @MustNotContainNull @Nonnull File[] goPathParts) throws IOException
IOException@Nonnull protected String getSpecialPartOfGoPath()
public boolean isCommandSupportVerbose()
protected void processConsoleOut(int exitCode,
@Nonnull
String out,
@Nonnull
String err)
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionCopyright © 2016–2019 Igor Maznitsa. All rights reserved.