File tree 1 file changed +16
-1
lines changed
src/main/java/io/gatling/mojo 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 17
17
package io .gatling .mojo ;
18
18
19
19
import io .gatling .plugin .BatchEnterprisePlugin ;
20
+ import io .gatling .plugin .configuration .PackageConfiguration ;
21
+ import io .gatling .plugin .exceptions .EnterprisePluginException ;
20
22
import java .io .File ;
21
23
import java .util .UUID ;
22
24
import org .apache .maven .plugin .MojoFailureException ;
@@ -51,6 +53,20 @@ public final class EnterpriseUploadMojo extends AbstractEnterprisePluginMojo {
51
53
52
54
@ Override
53
55
public void execute () throws MojoFailureException {
56
+ final BatchEnterprisePlugin enterprisePlugin = initBatchEnterprisePlugin ();
57
+
58
+ final String jsonConfig = PackageConfiguration .loadToJson (mavenProject .getBasedir ());
59
+
60
+ if (jsonConfig != null ) {
61
+ try {
62
+ getLog ().info ("Package configuration file detected, applying it." );
63
+ packageId = enterprisePlugin .uploadPackageConfiguration (jsonConfig ).toString ();
64
+ getLog ().info ("Package id: " + packageId );
65
+ } catch (EnterprisePluginException e ) {
66
+ throw new MojoFailureException ("Failed to upload package configuration" , e );
67
+ }
68
+ }
69
+
54
70
if (packageId == null && simulationId == null ) {
55
71
final String msg =
56
72
"Missing packageID\n "
@@ -62,7 +78,6 @@ public void execute() throws MojoFailureException {
62
78
}
63
79
64
80
final File file = enterprisePackage ();
65
- final BatchEnterprisePlugin enterprisePlugin = initBatchEnterprisePlugin ();
66
81
67
82
RecoverEnterprisePluginException .handle (
68
83
() ->
You can’t perform that action at this time.
0 commit comments