/maven-amps-plugin/src/main/java/com/atlassian/maven/plugins/amps/pdk/TestInstallMojo.java

https://bitbucket.org/mmeinhold/amps · Java · 30 lines · 27 code · 3 blank · 0 comment · 1 complexity · bdf844063e6b1c5cdce5bb40d785bf8b MD5 · raw file

  1. package com.atlassian.maven.plugins.amps.pdk;
  2. import com.atlassian.maven.plugins.amps.PdkParams;
  3. import com.atlassian.maven.plugins.amps.product.ProductHandler;
  4. import org.apache.maven.plugin.MojoExecutionException;
  5. import org.apache.maven.plugin.MojoFailureException;
  6. import org.apache.maven.plugins.annotations.Mojo;
  7. @Mojo(name = "test-install")
  8. public class TestInstallMojo extends AbstractPdkMojo
  9. {
  10. public void execute() throws MojoExecutionException, MojoFailureException
  11. {
  12. if(shouldBuildTestPlugin())
  13. {
  14. ensurePluginKeyExists();
  15. final ProductHandler product = createProductHandler(getProductId());
  16. getMavenGoals().installPlugin(new PdkParams.Builder()
  17. .testPlugin(true)
  18. .pluginKey(pluginKey)
  19. .server(server)
  20. .port(getHttpPort(product))
  21. .contextPath(getContextPath(product))
  22. .username(username)
  23. .password(password)
  24. .build());
  25. }
  26. }
  27. }