tooling/camel-kafka-connector-generator-maven-plugin/src/main/java/org/apache/camel/kafkaconnector/maven/CamelKafkaConnectorCreateMojo.java [113:147]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        props.put("componentName", name);
        props.put("componentSanitizedName", sanitizedName);
        props.put("componentDescription", name);
        try {
            Document pom = MavenUtils.createCrateXmlDocumentFromTemplate(pomTemplate, props);
            // Write the connector pom
            File pomFile = new File(directory, "pom.xml");
            writeXmlFormatted(pom, pomFile, getLog());
        } catch (Exception e) {
            getLog().error("Cannot create pom.xml file from Template: " + pomTemplate + " with properties: " + props, e);
            throw e;
        }
    }

    private void addConnectorAsProjectSubmodule(String sanitizedName) throws IOException {
        //add connector as a sub module
        Path parent = new File(projectDir, "pom.xml").toPath();
        List<String> lines = Files.readAllLines(parent);
        int modulesStart = -1;
        int modulesEnd = -1;
        for (int i = 0; i < lines.size(); i++) {
            String s = lines.get(i);
            if (s.contains("<modules>")) {
                modulesStart = i + 1;
            } else if (s.contains("</modules>")) {
                modulesEnd = i;
            }
        }
        lines = MavenUtils.concat(lines.subList(0, modulesStart).stream(),
                Stream.concat(lines.subList(modulesStart, modulesEnd).stream(),
                        Stream.of("        <module>camel-" + sanitizedName + KAFKA_CONNECTORS_SUFFIX + "</module>"))
                        .sorted().distinct(),
                lines.subList(modulesEnd, lines.size()).stream())
                .collect(Collectors.toList());
        Files.write(parent, lines);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tooling/camel-kafka-connector-generator-maven-plugin/src/main/java/org/apache/camel/kafkaconnector/maven/CamelKafkaConnectorKameletCreateMojo.java [105:139]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        props.put("componentName", name);
        props.put("componentSanitizedName", sanitizedName);
        props.put("componentDescription", name);
        try {
            Document pom = MavenUtils.createCrateXmlDocumentFromTemplate(pomTemplate, props);
            // Write the connector pom
            File pomFile = new File(directory, "pom.xml");
            writeXmlFormatted(pom, pomFile, getLog());
        } catch (Exception e) {
            getLog().error("Cannot create pom.xml file from Template: " + pomTemplate + " with properties: " + props, e);
            throw e;
        }
    }

    private void addConnectorAsProjectSubmodule(String sanitizedName) throws IOException {
        //add connector as a sub module
        Path parent = new File(projectDir, "pom.xml").toPath();
        List<String> lines = Files.readAllLines(parent);
        int modulesStart = -1;
        int modulesEnd = -1;
        for (int i = 0; i < lines.size(); i++) {
            String s = lines.get(i);
            if (s.contains("<modules>")) {
                modulesStart = i + 1;
            } else if (s.contains("</modules>")) {
                modulesEnd = i;
            }
        }
        lines = MavenUtils.concat(lines.subList(0, modulesStart).stream(),
                Stream.concat(lines.subList(modulesStart, modulesEnd).stream(),
                        Stream.of("        <module>camel-" + sanitizedName + KAFKA_CONNECTORS_SUFFIX + "</module>"))
                        .sorted().distinct(),
                lines.subList(modulesEnd, lines.size()).stream())
                .collect(Collectors.toList());
        Files.write(parent, lines);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



