From c9bd9e9f6103b2c2bfc117330f7f7a0ca5ea2bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Wed, 22 May 2024 00:40:10 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=20`simplify-pom`?= =?UTF-8?q?=20=E6=8F=92=E4=BB=B6=E7=94=9F=E6=88=90=20``=20?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=EF=BC=8C=E5=8F=98=E9=87=8F=E5=8F=98?= =?UTF-8?q?=E4=B8=BA=E4=BA=86=E5=AE=9E=E9=99=85=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maven/plugin/mojo/file/FileGenerateMojo.java | 2 +- .../simplify/simplifier/AbstractPomSimplifier.java | 11 ----------- .../mojo/simplify/simplifier/pom/PomSimplifier.java | 2 -- .../icu/easyj/maven/plugin/mojo/utils/IOUtils.java | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/file/FileGenerateMojo.java b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/file/FileGenerateMojo.java index 5f13036..f324e8a 100644 --- a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/file/FileGenerateMojo.java +++ b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/file/FileGenerateMojo.java @@ -133,7 +133,7 @@ public void execute() throws MojoExecutionException { getLog().info("fileList: " + generateFiles.toString()); for (FileInfo fileInfo : generateFiles) { - if (StringUtils.isEmpty(fileInfo.getPath()) || fileInfo.isEnabled()) { + if (StringUtils.isEmpty(fileInfo.getPath()) || !fileInfo.isEnabled()) { continue; } diff --git a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/AbstractPomSimplifier.java b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/AbstractPomSimplifier.java index c4b138a..591c65e 100644 --- a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/AbstractPomSimplifier.java +++ b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/AbstractPomSimplifier.java @@ -857,17 +857,6 @@ public void removeProfiles() { } } - public void keepProfiles() { - if (isEmpty(originalModel.getProfiles())) { - return; - } - - if ((originalModel.getParent() != null && model.getParent() != null) - || (originalModel.getParent() == null && model.getParent() == null)) { - originalModel.setProfiles(model.getProfiles()); - } - } - //endregion ## diff --git a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/pom/PomSimplifier.java b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/pom/PomSimplifier.java index 00e6f09..f109a3c 100644 --- a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/pom/PomSimplifier.java +++ b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/simplify/simplifier/pom/PomSimplifier.java @@ -43,8 +43,6 @@ public void doSimplify() { this.removeModules(); this.removeLocalProperties(); - - this.keepProfiles(); } diff --git a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/utils/IOUtils.java b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/utils/IOUtils.java index 44182f2..c97e4e8 100644 --- a/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/utils/IOUtils.java +++ b/easyj-maven-plugin/src/main/java/icu/easyj/maven/plugin/mojo/utils/IOUtils.java @@ -122,7 +122,7 @@ public static void createFile(File newFile, String text) throws IOException { } try (FileOutputStream out = new FileOutputStream(newFile)) { - out.write(text.getBytes()); + out.write(text.replaceAll("\r", "").getBytes()); out.flush(); } }