Skip to content

Commit

Permalink
feat: enterprise package generation rework
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Jan 30, 2024
1 parent ba0cd4a commit a8785ab
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 322 deletions.
14 changes: 1 addition & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@
<encoding>UTF-8</encoding>
<maven.compiler.release>11</maven.compiler.release>
<maven3.version>3.0</maven3.version>
<plexus-utils.version>3.4.2</plexus-utils.version>
<header.basedir>${project.basedir}</header.basedir>
<junit.version>5.10.1</junit.version>
<zt-zip.version>1.16</zt-zip.version>
<gatling-enterprise-plugin-commons.version>1.9.0-M5</gatling-enterprise-plugin-commons.version>

<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<maven-plugin-plugin.version>3.11.0</maven-plugin-plugin.version>
Expand All @@ -58,7 +57,6 @@
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<maven-surefire-plugin.version>3.1.0</maven-surefire-plugin.version>
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
<gatling-enterprise-plugin-commons.version>1.8.0</gatling-enterprise-plugin-commons.version>
</properties>

<dependencies>
Expand All @@ -80,16 +78,6 @@
<version>${maven3.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>${plexus-utils.version}</version>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-zip</artifactId>
<version>${zt-zip.version}</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-enterprise-plugin-commons</artifactId>
Expand Down
24 changes: 1 addition & 23 deletions src/main/java/io/gatling/mojo/AbstractGatlingMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
Expand All @@ -38,9 +36,6 @@

public abstract class AbstractGatlingMojo extends AbstractMojo {

private static final String FRONTLINE_MAVEN_PLUGIN_GROUP_ID = "io.gatling.frontline";
private static final String FRONTLINE_MAVEN_PLUGIN_ARTIFACT_ID = "frontline-maven-plugin";

/** Use this folder as the configuration directory. */
@Parameter(
property = "gatling.configFolder",
Expand All @@ -66,23 +61,6 @@ public abstract class AbstractGatlingMojo extends AbstractMojo {
/** Maven's repository. */
@Component protected RepositorySystem repository;

protected void checkPluginPreConditions() throws MojoFailureException {
final boolean obsoletePluginFound =
mavenProject.getPluginArtifacts().stream().anyMatch(AbstractGatlingMojo::isFrontLinePlugin);
if (obsoletePluginFound) {
throw new MojoFailureException(
"Plugin `frontline-maven-plugin` is no longer needed, its functionality is now included in `gatling-maven-plugin`.\n"
+ "Please remove `frontline-maven-plugin` from your pom.xml plugins configuration.\n"
+ "Please use gatling:enterprisePackage instead of configuring it on package phase.\n"
+ "See https://gatling.io/docs/gatling/reference/current/extensions/maven_plugin/ for more information ");
}
}

private static boolean isFrontLinePlugin(Artifact artifact) {
return artifact.getGroupId().equals(FRONTLINE_MAVEN_PLUGIN_GROUP_ID)
&& artifact.getArtifactId().equals(FRONTLINE_MAVEN_PLUGIN_ARTIFACT_ID);
}

protected List<String> buildTestClasspath() throws Exception {
List<String> testClasspathElements = new ArrayList<>();
testClasspathElements.addAll(mavenProject.getTestClasspathElements());
Expand All @@ -100,7 +78,7 @@ protected void addArg(List<String> args, String flag, Object value) {
}
}

private PluginLogger newPluginLogger() {
protected PluginLogger newPluginLogger() {
return new PluginLogger() {
@Override
public void info(String message) {
Expand Down
41 changes: 0 additions & 41 deletions src/main/java/io/gatling/mojo/DeprecatedFrontLineMojo.java

This file was deleted.

Loading

0 comments on commit a8785ab

Please sign in to comment.