|
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;
|
@@ -504,8 +507,26 @@ public static void runFrontendBuild(PluginAdapterBase adapter)
|
504 | 507 | FrontendTools tools = new FrontendTools(settings);
|
505 | 508 | tools.validateNodeAndNpmVersion();
|
506 | 509 | BuildFrontendUtil.runVite(adapter, tools);
|
507 |
| - ProdBundleUtils.compressBundle(adapter.projectBaseDirectory().toFile(), |
508 |
| - adapter.servletResourceOutputDirectory()); |
| 510 | + String tokenContent = ""; |
| 511 | + File tokenFile = getTokenFile(adapter); |
| 512 | + try { |
| 513 | + tokenContent = Files.readString(tokenFile.toPath()); |
| 514 | + tokenFile.delete(); |
| 515 | + } catch (IOException ex) { |
| 516 | + getLogger().error("Failed to read token file content.", ex); |
| 517 | + } |
| 518 | + |
| 519 | + try { |
| 520 | + ProdBundleUtils.compressBundle( |
| 521 | + adapter.projectBaseDirectory().toFile(), |
| 522 | + adapter.servletResourceOutputDirectory()); |
| 523 | + } finally { |
| 524 | + try { |
| 525 | + Files.writeString(tokenFile.toPath(), tokenContent); |
| 526 | + } catch (IOException ex) { |
| 527 | + getLogger().error("Failed to write token file content.", ex); |
| 528 | + } |
| 529 | + } |
509 | 530 | }
|
510 | 531 |
|
511 | 532 | /**
|
|
0 commit comments