Class AbstractGolangMojo

    • Field Detail

      • buildFlagsToIgnore

        protected final Set<String> buildFlagsToIgnore
        set of flags to be ignored among build and extra build flags, for inside use
      • tempBuildFlags

        protected final List<String> tempBuildFlags
      • settings

        @Parameter(defaultValue="${settings}",
                   readonly=true)
        protected org.apache.maven.settings.Settings settings
    • Constructor Detail

      • AbstractGolangMojo

        public AbstractGolangMojo()
    • Method Detail

      • setWorkingDir

        public final void setWorkingDir​(@Nullable
                                        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 List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
      • doesNeedSessionLock

        protected boolean doesNeedSessionLock()
      • getTempFileFolder

        @Nonnull
        protected File getTempFileFolder()
      • 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()
      • getConnectionTimeout

        public int getConnectionTimeout()
      • isUseEnvVars

        public boolean isUseEnvVars()
      • isKeepSdkArchive

        public boolean isKeepSdkArchive()
      • isKeepUnarchFolderIfError

        public boolean isKeepUnarchFolderIfError()
      • isCheckSdkHash

        public boolean isCheckSdkHash()
      • isVerbose

        public boolean isVerbose()
      • isDisableSdkLoad

        public boolean isDisableSdkLoad()
      • getBuildFlags

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

        @Nonnull
        @MustNotContainNull
        protected String[] getExtraBuildFlags()
      • isUseMavenProxy

        public boolean isUseMavenProxy()
      • getSupposeSdkArchiveFileName

        public boolean getSupposeSdkArchiveFileName()
      • isDisableSslCheck

        public boolean isDisableSslCheck()
      • setDisableSslCheck

        public void setDisableSslCheck​(boolean flag)
      • addTmpBuildFlagIfNotPresented

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

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

        protected void initConsoleBuffers()
      • findGoRoot

        @Nonnull
        protected File findGoRoot​(@Nullable
                                  ProxySettings proxySettings)
                           throws IOException,
                                  org.apache.maven.plugin.MojoFailureException,
                                  org.apache.maven.plugin.MojoExecutionException
        Throws:
        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
                                                 String consoleOut,
                                                 @Nonnull
                                                 String consoleErr)
                                          throws IOException,
                                                 org.apache.maven.plugin.MojoExecutionException
        Throws:
        IOException
        org.apache.maven.plugin.MojoExecutionException
      • doLogging

        protected void doLogging​(int resultCode,
                                 boolean error,
                                 @Nonnull
                                 String outLog,
                                 @Nonnull
                                 String errLog)
                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • 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()
      • 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 String[] getTailArguments()
      • getOptionalExtraTailArguments

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

        @Nonnull
        public String makeExecutableFileSubpath()
      • getCommandFlags

        @Nonnull
        @MustNotContainNull
        public abstract String[] getCommandFlags()
      • registerOutputBuffers

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

        @Nonnull
        protected 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 String makePathFromExtraGoPathElements()
      • isCommandSupportVerbose

        public boolean isCommandSupportVerbose()
      • getSkipMojoPropertySuffix

        @Nullable
        protected String getSkipMojoPropertySuffix()
      • prepareExecutor

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