Skip to content

Commit

Permalink
#7780: removing File.separator
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroslawmalekcodete committed Sep 18, 2018
1 parent dbc261b commit 7bd324a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.maven.shared.invoker.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -158,9 +159,9 @@ private Map<String, Path> jarsFromRepo() {
private List<String> mavenBuildClasspath() {
String jarPathsAsString = null;
try {
String absolutePath = new File(pathToMavenRepo).getAbsolutePath() + File.separator + MAVEN_BUILT_CLASSPATH_FILE_NAME;
InputStream isPaths = Files.newInputStream(Paths.get(absolutePath));
jarPathsAsString = IOUtils.toString(isPaths, StandardCharsets.UTF_8);
File fileToClasspath = new File(pathToMavenRepo, MAVEN_BUILT_CLASSPATH_FILE_NAME);
InputStream fileInputStream = new FileInputStream(fileToClasspath);
jarPathsAsString = IOUtils.toString(fileInputStream, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public String createPom(Params params) throws IOException {
}

private String configureBuildClasspathPlugin(String pathToMavenRepo, String mavenBuiltClasspathFileName, String pomAsString) {
String absolutePath = new File(pathToMavenRepo).getAbsolutePath();
String absolutePath = new File(pathToMavenRepo, mavenBuiltClasspathFileName).getAbsolutePath();
return pomAsString.replace(
"<outputFile>mavenBuiltClasspathFile</outputFile>",
"<outputFile>" + absolutePath + File.separator +mavenBuiltClasspathFileName + "</outputFile>");
"<outputFile>" + absolutePath + "</outputFile>");
}

private String configureGoal(String goal, String pomAsString) {
Expand Down

0 comments on commit 7bd324a

Please sign in to comment.