|
22 | 22 | import java.net.URISyntaxException;
|
23 | 23 | import java.net.URL;
|
24 | 24 | import java.nio.charset.StandardCharsets;
|
| 25 | +import java.nio.file.Files; |
| 26 | +import java.nio.file.Path; |
| 27 | +import java.nio.file.Paths; |
25 | 28 | import java.util.ArrayList;
|
26 | 29 | import java.util.Arrays;
|
27 | 30 | import java.util.Collections;
|
@@ -493,8 +496,26 @@ public static void runFrontendBuild(PluginAdapterBase adapter)
|
493 | 496 | FrontendTools tools = new FrontendTools(settings);
|
494 | 497 | tools.validateNodeAndNpmVersion();
|
495 | 498 | BuildFrontendUtil.runVite(adapter, tools);
|
496 |
| - ProdBundleUtils.compressBundle(adapter.projectBaseDirectory().toFile(), |
497 |
| - adapter.servletResourceOutputDirectory()); |
| 499 | + String tokenContent = ""; |
| 500 | + File tokenFile = getTokenFile(adapter); |
| 501 | + try { |
| 502 | + tokenContent = Files.readString(tokenFile.toPath()); |
| 503 | + tokenFile.delete(); |
| 504 | + } catch (IOException ex) { |
| 505 | + getLogger().error("Failed to read token file content.", ex); |
| 506 | + } |
| 507 | + |
| 508 | + try { |
| 509 | + ProdBundleUtils.compressBundle( |
| 510 | + adapter.projectBaseDirectory().toFile(), |
| 511 | + adapter.servletResourceOutputDirectory()); |
| 512 | + } finally { |
| 513 | + try { |
| 514 | + Files.writeString(tokenFile.toPath(), tokenContent); |
| 515 | + } catch (IOException ex) { |
| 516 | + getLogger().error("Failed to write token file content.", ex); |
| 517 | + } |
| 518 | + } |
498 | 519 | }
|
499 | 520 |
|
500 | 521 | /**
|
|
0 commit comments