Skip to content

Commit

Permalink
兼容java8代码
Browse files Browse the repository at this point in the history
  • Loading branch information
cgw committed May 7, 2023
1 parent fcf87dc commit 373327a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.file.Path;
Expand Down Expand Up @@ -438,8 +439,11 @@ private boolean pack(DeployContext context) {
AppExtendNode appExtend = context.getApp().getAppExtend();
Resource resource = new PathMatchingResourcePatternResolver()
.getResource(ResourceUtils.CLASSPATH_URL_PREFIX + "maven/app_node_pom.xml");
try (FileOutputStream out = new FileOutputStream(context.getLocalPathOfBranch() + "pom.xml")) {
String lines = new String(resource.getInputStream().readAllBytes(), "UTF-8");
try (InputStream in = resource.getInputStream();
FileOutputStream out = new FileOutputStream(context.getLocalPathOfBranch() + "pom.xml")) {
byte[] buffer = new byte[in.available()];
in.read(buffer);
String lines = new String(buffer, "UTF-8");
String result = lines.replace("${nodeVersion}", appExtend.getNodeVersion())
.replace("${npmVersion}", appExtend.getNpmVersion().substring(1))
.replace("${installDirectory}", mavenRepo() + "node/" + appExtend.getNodeVersion());
Expand Down

0 comments on commit 373327a

Please sign in to comment.