Skip to content

Commit

Permalink
小调整。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed May 21, 2024
1 parent 35e7303 commit 9e75e7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ protected void writePom(Model model, File pomFile) throws MojoExecutionException
}

// 去除 '\r'
pomFileString = pomFileString.replace("\r", "");
pomFileString = pomFileString.replaceAll("\r", "");
// // 不同的maven版本,换行数量有些微不同,将多个连续的换行替换成单个换行
// pomFileString = pomFileString.replaceAll("\n{2,}", IOUtils.LINE_SEPARATOR);
// 去除多余的空格
pomFileString = pomFileString.replace(" />", "/>");
pomFileString = pomFileString.replaceAll(" />", "/>");
// 移除不必要的换行
pomFileString = pomFileString.replaceAll("\n{2,}<project ", "\n<project ");

// Write String to POM file
this.writeStringToFile(pomFileString, pomFile, model.getModelEncoding());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,10 @@ private void writeMailingList(MailingList mailingList, MXSerializer serializer)

private void writeModel(MXSerializer serializer) throws IOException {
if (this.fileComment != null) {
serializer.comment(this.fileComment);
serializer.text(IOUtils.LINE_SEPARATOR);
serializer.comment(this.fileComment);
}
serializer.text(IOUtils.LINE_SEPARATOR);

//serializer.setPrefix("", "http://maven.apache.org/POM/4.0.0");
//serializer.setPrefix("xsi", "http://www.w3.org/2001/XMLSchema-instance");
Expand Down

0 comments on commit 9e75e7e

Please sign in to comment.