You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/03/03 08:47:46 UTC

[camel] 02/02: [Minor] add license to top of archetype-catalog for check style pass

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9fda42d292a4d447e46f18dc08a949e915273b8f
Author: shmakovaa <ye...@gmail.com>
AuthorDate: Fri Mar 3 02:03:41 2023 +0500

    [Minor] add license to top of archetype-catalog for check style pass
---
 .../packaging/PackageArchetypeCatalogMojo.java     | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageArchetypeCatalogMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageArchetypeCatalogMojo.java
index 928c18e8404..e0d39297c3c 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageArchetypeCatalogMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageArchetypeCatalogMojo.java
@@ -205,8 +205,26 @@ public class PackageArchetypeCatalogMojo extends AbstractMojo {
     }
 
     private static void writeTop(FileOutputStream fos) throws IOException {
-        String top = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<archetype-catalog>\n  <archetypes>";
-        fos.write(top.getBytes());
+        fos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes());
+        writeLicense(fos);
+        fos.write("<archetype-catalog>\n  <archetypes>".getBytes());
+    }
+
+    private static void writeLicense(FileOutputStream fos) throws IOException {
+        fos.write("<!--\n\n".getBytes());
+        fos.write("    Licensed to the Apache Software Foundation (ASF) under one or more\n".getBytes());
+        fos.write("    contributor license agreements.  See the NOTICE file distributed with\n".getBytes());
+        fos.write("    this work for additional information regarding copyright ownership.\n".getBytes());
+        fos.write("    The ASF licenses this file to You under the Apache License, Version 2.0\n".getBytes());
+        fos.write("    (the \"License\"); you may not use this file except in compliance with\n".getBytes());
+        fos.write("    the License.  You may obtain a copy of the License at\n".getBytes());
+        fos.write("\n         http://www.apache.org/licenses/LICENSE-2.0\n\n".getBytes());
+        fos.write("    Unless required by applicable law or agreed to in writing, software\n".getBytes());
+        fos.write("    distributed under the License is distributed on an \"AS IS\" BASIS,\n".getBytes());
+        fos.write("    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n".getBytes());
+        fos.write("    See the License for the specific language governing permissions and\n".getBytes());
+        fos.write("    limitations under the License.\n".getBytes());
+        fos.write("\n-->\n".getBytes());
     }
 
     private static class ArchetypeModel {