// Path: mvn-golang-wrapper/src/main/java/com/igormaznitsa/mvngolang/utils/ProxySettings.java
// public class ProxySettings {
// 
//   /**
//    * The proxy host.
//    */
//   public String host = "127.0.0.1";
// 
//   /**
//    * The proxy protocol.
//    */
//   public String protocol = "http";
// 
//   /**
//    * The proxy port.
//    */
//   public int port = 80;
// 
//   /**
//    * The proxy user.
//    */
//   public String username;
// 
//   /**
//    * The proxy password.
//    */
//   public String password = "";
// 
//   /**
//    * The list of non-proxy hosts (delimited by |).
//    */
//   public String nonProxyHosts;
// 
//   public ProxySettings() {
//   }
// 
//   public ProxySettings(@Nonnull final Proxy mavenProxy) {
//     this.protocol = mavenProxy.getProtocol();
//     this.host = mavenProxy.getHost();
//     this.port = mavenProxy.getPort();
//     this.username = mavenProxy.getUsername();
//     this.password = mavenProxy.getPassword();
//     this.nonProxyHosts = mavenProxy.getNonProxyHosts();
//   }
// 
//   public boolean hasCredentials() {
//     return this.username != null && this.password != null;
//   }
// 
//   @Override
//   @Nonnull
//   public String toString() {
//     return this.protocol + "://" + this.host + ":" + this.port;
//   }
// }


import com.igormaznitsa.mvngolang.utils.ProxySettings;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.FileUtils;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
    try {
      final File goStoreFolder = new File(getStoreFolder());
      if (goStoreFolder.isDirectory()) {
        getLog().info("Deleting the Store Folder : " + goStoreFolder);
        FileUtils.deleteDirectory(goStoreFolder);
      } else {
        getLog().info("The Store Folder does not found : " + goStoreFolder);
      }
    } catch (IOException ex) {
      throw new MojoFailureException("Can't delete the Store Folder", ex);
    }
  }

  private void cleanGoPath() throws MojoFailureException {
    try {
      final File[] goPathFolders = findGoPath(false);
      for (final File f : goPathFolders) {
        if (f.isDirectory()) {
          getLog().warn("Cleaning the Go Path folder : " + f);
          FileUtils.cleanDirectory(f);
        } else {
          getLog().info("Can't find GOPATH folder : " + f);
        }
      }
    } catch (IOException ex) {
      throw new MojoFailureException("Can't clean the Go Path folder", ex);
    }
  }

  @Override
// Path: mvn-golang-wrapper/src/main/java/com/igormaznitsa/mvngolang/utils/ProxySettings.java
// public class ProxySettings {
// 
//   /**
//    * The proxy host.
//    */
//   public String host = "127.0.0.1";
// 
//   /**
//    * The proxy protocol.
//    */
//   public String protocol = "http";
// 
//   /**
//    * The proxy port.
//    */
//   public int port = 80;
// 
//   /**
//    * The proxy user.
//    */
//   public String username;
// 
//   /**
//    * The proxy password.
//    */
//   public String password = "";
// 
//   /**
//    * The list of non-proxy hosts (delimited by |).
//    */
//   public String nonProxyHosts;
// 
//   public ProxySettings() {
//   }
// 
//   public ProxySettings(@Nonnull final Proxy mavenProxy) {
//     this.protocol = mavenProxy.getProtocol();
//     this.host = mavenProxy.getHost();
//     this.port = mavenProxy.getPort();
//     this.username = mavenProxy.getUsername();
//     this.password = mavenProxy.getPassword();
//     this.nonProxyHosts = mavenProxy.getNonProxyHosts();
//   }
// 
//   public boolean hasCredentials() {
//     return this.username != null && this.password != null;
//   }
// 
//   @Override
//   @Nonnull
//   public String toString() {
//     return this.protocol + "://" + this.host + ":" + this.port;
//   }
// }


// Path: mvn-golang-wrapper/src/main/java/com/igormaznitsa/mvngolang/GolangCleanMojo.java
import com.igormaznitsa.mvngolang.utils.ProxySettings;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.FileUtils;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;

    try {
      final File goStoreFolder = new File(getStoreFolder());
      if (goStoreFolder.isDirectory()) {
        getLog().info("Deleting the Store Folder : " + goStoreFolder);
        FileUtils.deleteDirectory(goStoreFolder);
      } else {
        getLog().info("The Store Folder does not found : " + goStoreFolder);
      }
    } catch (IOException ex) {
      throw new MojoFailureException("Can't delete the Store Folder", ex);
    }
  }

  private void cleanGoPath() throws MojoFailureException {
    try {
      final File[] goPathFolders = findGoPath(false);
      for (final File f : goPathFolders) {
        if (f.isDirectory()) {
          getLog().warn("Cleaning the Go Path folder : " + f);
          FileUtils.cleanDirectory(f);
        } else {
          getLog().info("Can't find GOPATH folder : " + f);
        }
      }
    } catch (IOException ex) {
      throw new MojoFailureException("Can't clean the Go Path folder", ex);
    }
  }

  @Override
  public void afterExecution(@Nullable final ProxySettings proxySettings, final boolean error)