[ 
https://issues.apache.org/jira/browse/MPLUGIN-390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615719#comment-17615719
 ] 

ASF GitHub Bot commented on MPLUGIN-390:
----------------------------------------

gnodet commented on code in PR #67:
URL: https://github.com/apache/maven-plugin-tools/pull/67#discussion_r992205990


##########
maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/CachingOutputStream.java:
##########
@@ -0,0 +1,63 @@
+package org.apache.maven.tools.plugin.generator;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.Objects;
+
+/**
+ * Caching OutputStream to avoid overwriting a file with
+ * the same content.
+ */
+public class CachingOutputStream extends ByteArrayOutputStream

Review Comment:
   Updated with the `CachingOutputStream` from plexus-utils.





> Do not overwrite generate files with no content change
> ------------------------------------------------------
>
>                 Key: MPLUGIN-390
>                 URL: https://issues.apache.org/jira/browse/MPLUGIN-390
>             Project: Maven Plugin Tools
>          Issue Type: Improvement
>            Reporter: Guillaume Nodet
>            Priority: Major
>             Fix For: 3.7.0
>
>
> This breaks incremental compilation as the jars will be regenerated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to