Class AbstractGolangMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.igormaznitsa.mvngolang.AbstractGolangMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractGoDependencyAwareMojo, AbstractGoPackageAwareMojo

public abstract class AbstractGolangMojo
extends org.apache.maven.plugin.AbstractMojo
  • Field Details

  • Constructor Details

  • Method Details

    • getWorkingDir

      @Nullable public final java.lang.String getWorkingDir()
    • setWorkingDir

      public final void setWorkingDir​(@Nullable java.lang.String path)
    • isModuleMode

      public boolean isModuleMode()
    • setModuleMode

      public void setModuleMode​(boolean value)
    • getArtifactResolver

      @Nonnull public org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver getArtifactResolver()
    • getRemoteRepositories

      @Nonnull @MustNotContainNull public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
    • doesNeedSessionLock

      protected boolean doesNeedSessionLock()
    • getTempFileFolder

      @Nonnull protected java.io.File getTempFileFolder()
    • adaptExecNameForOS

      @Nonnull protected static java.lang.String adaptExecNameForOS​(@Nonnull java.lang.String execName)
    • findExisting

      @Nullable protected static java.io.File findExisting​(@Nonnull @MayContainNull java.io.File... files)
    • isFilterEnvPath

      public boolean isFilterEnvPath()
    • isSkip

      public boolean isSkip()
    • isEnforceGoPathToEnd

      public boolean isEnforceGoPathToEnd()
    • getProject

      @Nonnull public org.apache.maven.project.MavenProject getProject()
    • getExecution

      @Nonnull public org.apache.maven.plugin.MojoExecution getExecution()
    • getSession

      @Nonnull public org.apache.maven.execution.MavenSession getSession()
    • isIgnoreErrorExitCode

      public boolean isIgnoreErrorExitCode()
    • getEnv

      @Nonnull public java.util.Map<?,​?> getEnv()
    • getSdkDownloadUrl

      @Nullable public java.lang.String getSdkDownloadUrl()
    • getExecSubpath

      @Nonnull public java.lang.String getExecSubpath()
    • getConnectionTimeout

      public int getConnectionTimeout()
    • getExec

      @Nonnull public java.lang.String getExec()
    • isUseEnvVars

      public boolean isUseEnvVars()
    • isKeepSdkArchive

      public boolean isKeepSdkArchive()
    • isKeepUnarchFolderIfError

      public boolean isKeepUnarchFolderIfError()
    • getSdkArchiveName

      @Nullable public java.lang.String getSdkArchiveName()
    • getReportsFolder

      @Nonnull public java.lang.String getReportsFolder()
    • getOutLogFile

      @Nullable public java.lang.String getOutLogFile()
    • getErrLogFile

      @Nullable public java.lang.String getErrLogFile()
    • isCheckSdkHash

      public boolean isCheckSdkHash()
    • getStoreFolder

      @Nonnull public java.lang.String getStoreFolder()
    • getUseGoTool

      @Nullable public java.lang.String getUseGoTool()
    • isVerbose

      public boolean isVerbose()
    • isDisableSdkLoad

      public boolean isDisableSdkLoad()
    • getSdkSite

      @Nonnull public java.lang.String getSdkSite()
    • getBuildFlags

      @Nonnull @MustNotContainNull public java.lang.String[] getBuildFlags()
    • getExtraBuildFlags

      @Nonnull @MustNotContainNull protected java.lang.String[] getExtraBuildFlags()
    • findGoPath

      @Nonnull @MustNotContainNull public java.io.File[] findGoPath​(boolean ensureExist) throws java.io.IOException
      Throws:
      java.io.IOException
    • findGoRootBootstrap

      @Nullable public java.io.File findGoRootBootstrap​(boolean ensureExist) throws java.io.IOException
      Throws:
      java.io.IOException
    • getOs

      @Nonnull public java.lang.String getOs()
    • getArch

      @Nullable public java.lang.String getArch()
    • getGoRoot

      @Nullable public java.lang.String getGoRoot()
    • getGoCache

      @Nullable public java.lang.String getGoCache()
    • getGoRootBootstrap

      @Nullable public java.lang.String getGoRootBootstrap()
    • getGoBin

      @Nullable public java.lang.String getGoBin()
    • getGoPath

      @Nonnull public java.lang.String getGoPath()
    • getTargetArm

      @Nullable public java.lang.String getTargetArm()
    • getTarget386

      @Nullable public java.lang.String getTarget386()
    • getTargetOS

      @Nullable public java.lang.String getTargetOS()
    • getTargetArch

      @Nullable public java.lang.String getTargetArch()
    • isUseMavenProxy

      public boolean isUseMavenProxy()
    • getSupposeSdkArchiveFileName

      public boolean getSupposeSdkArchiveFileName()
    • isDisableSslCheck

      public boolean isDisableSslCheck()
    • setDisableSslCheck

      public void setDisableSslCheck​(boolean flag)
    • getProxy

      @Nullable public ProxySettings getProxy()
    • getOSXVersion

      @Nullable public java.lang.String getOSXVersion()
    • getGoVersion

      @Nonnull public java.lang.String getGoVersion()
    • getSources

      @Nonnull public java.io.File getSources​(boolean ensureExist) throws java.io.IOException
      Throws:
      java.io.IOException
    • addTmpBuildFlagIfNotPresented

      protected void addTmpBuildFlagIfNotPresented​(@Nonnull @MustNotContainNull java.lang.String... flags)
    • logOptionally

      protected void logOptionally​(@Nonnull java.lang.String message)
    • initConsoleBuffers

      protected void initConsoleBuffers()
    • findGoRoot

      @Nonnull protected java.io.File findGoRoot​(@Nullable ProxySettings proxySettings) throws java.io.IOException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      java.io.IOException
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
    • isHideBanner

      public boolean isHideBanner()
    • doesNeedOneMoreAttempt

      protected boolean doesNeedOneMoreAttempt​(@Nonnull org.zeroturnaround.exec.ProcessResult result, @Nonnull java.lang.String consoleOut, @Nonnull java.lang.String consoleErr) throws java.io.IOException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      java.io.IOException
      org.apache.maven.plugin.MojoExecutionException
    • doMainBusiness

      protected boolean doMainBusiness​(@Nullable ProxySettings proxySettings, int maxAttempts) throws java.lang.InterruptedException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException, java.io.IOException
      Throws:
      java.lang.InterruptedException
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
      java.io.IOException
    • execute

      public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • doInit

      public void doInit() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
    • beforeExecution

      public void beforeExecution​(@Nullable ProxySettings proxySettings) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
    • afterExecution

      public void afterExecution​(@Nullable ProxySettings proxySettings, boolean error) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
    • isEnforcePrintOutput

      public boolean isEnforcePrintOutput()
    • printLogs

      protected void printLogs​(boolean forcePrint, boolean errorDetected, @Nonnull java.lang.String outLog, @Nonnull java.lang.String errLog)
    • isSourceFolderRequired

      public boolean isSourceFolderRequired()
    • isMojoMustNotBeExecuted

      public boolean isMojoMustNotBeExecuted() throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • getTailArguments

      @Nonnull @MustNotContainNull public abstract java.lang.String[] getTailArguments()
    • getOptionalExtraTailArguments

      @Nonnull @MustNotContainNull public java.lang.String[] getOptionalExtraTailArguments()
    • makeExecutableFileSubpath

      @Nonnull public java.lang.String makeExecutableFileSubpath()
    • getGoCommand

      @Nonnull public abstract java.lang.String getGoCommand()
    • getCommandFlags

      @Nonnull @MustNotContainNull public abstract java.lang.String[] getCommandFlags()
    • prepareExecutor

      @Nullable protected org.zeroturnaround.exec.ProcessExecutor prepareExecutor​(@Nullable ProxySettings proxySettings) throws java.io.IOException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      java.io.IOException
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException
    • registerOutputBuffers

      protected void registerOutputBuffers​(@Nonnull org.zeroturnaround.exec.ProcessExecutor executor)
    • registerEnvVars

      protected void registerEnvVars​(@Nonnull org.zeroturnaround.exec.ProcessExecutor result, @Nonnull java.io.File theGoRoot, @Nullable java.lang.String theGoBin, @Nullable java.lang.String theGoCache, @Nonnull java.io.File sourcesFile, @MustNotContainNull @Nonnull java.io.File[] goPathParts) throws java.io.IOException
      Throws:
      java.io.IOException
    • findAllGoModsInFolder

      @Nonnull @MustNotContainNull protected java.util.List<java.io.File> findAllGoModsInFolder​(@Nonnull @MustNotContainNull java.io.File folder) throws java.io.IOException
      Throws:
      java.io.IOException
    • getWorkingDirectoryForExecutor

      @Nonnull protected java.io.File getWorkingDirectoryForExecutor() throws java.io.IOException
      Throws:
      java.io.IOException
    • getSpecialPartOfGoPath

      @Nonnull protected java.lang.String getSpecialPartOfGoPath()
      Internal method which returns special part of GOPATH which can be formed by mojos. Must be either empty or contain folders divided by file path separator.
      Returns:
      special part of GOPATH, must not be null, by default must be empty
    • makePathFromExtraGoPathElements

      @Nonnull protected java.lang.String makePathFromExtraGoPathElements()
    • isCommandSupportVerbose

      public boolean isCommandSupportVerbose()
    • getSkipMojoPropertySuffix

      @Nullable protected java.lang.String getSkipMojoPropertySuffix()
    • processConsoleOut

      protected void processConsoleOut​(int exitCode, @Nonnull java.lang.String out, @Nonnull java.lang.String err) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException