<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2021-2023 Steinar Bang                                     -->
<!--                                                                      -->
<!-- Licensed 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.                                       -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xml:space="preserve">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>no.priv.bang.pom</groupId>
        <artifactId>bang-bompom</artifactId>
        <version>2.1.2</version>
    </parent>
    <artifactId>bang-pom</artifactId>

    <packaging>pom</packaging>

    <name>Master parent POM</name>
    <description>Common maven plugin configurations and dependency management</description>

    <modules>
        <module>bang-app-pom</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <release>17</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.10.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.20.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven.bundle.plugin.version}</version>
                    <configuration>
                        <supportedProjectTypes>
                            <supportedProjectType>jar</supportedProjectType>
                            <supportedProjectType>bundle</supportedProjectType>
                            <supportedProjectType>war</supportedProjectType>
                        </supportedProjectTypes>
                        <instructions>
                            <!-- Enable processing of OSGI DS component annotations -->
                            <_dsannotations>*</_dsannotations>
                            <!-- Inherit service injections from base class -->
                            <_dsannotations-options>inherit</_dsannotations-options>
                            <!-- Enable processing of OSGI metatype annotations -->
                            <_metatypeannotations>*</_metatypeannotations>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>manifest</id>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                            <configuration>
                                <supportIncrementalBuild>true</supportIncrementalBuild>
                            </configuration>
                        </execution>
                        <execution>
                            <id>bundle</id>
                            <goals>
                                <goal>bundle</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>${karaf.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <startLevel>80</startLevel>
                        <includeTransitiveDependency>false</includeTransitiveDependency>
                        <aggregateFeatures>false</aggregateFeatures>
                        <includeProjectArtifact>true</includeProjectArtifact>
                        <primaryFeatureName>${karaf-feature-name}</primaryFeatureName>
                    </configuration>
                    <executions>
                        <execution>
                            <id>generate-features-file</id>
                            <goals>
                                <goal>features-generate-descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-services-maven-plugin</artifactId>
                    <version>${karaf.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.15.1</version>
                    <configuration>
                        <nodeVersion>v20.18.0</nodeVersion>
                        <workingDirectory>src/main/frontend</workingDirectory>
                        <installDirectory>target</installDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>install node and npm</id>
                            <goals>
                                <goal>install-node-and-npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>vite-build</id>
                            <goals>
                                <goal>npx</goal>
                            </goals>
                            <configuration>
                                <arguments>vite build</arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.12</version>
                </plugin>
                <plugin>
                    <groupId>org.eluder.coveralls</groupId>
                    <artifactId>coveralls-maven-plugin</artifactId>
                    <version>4.3.0</version>
                    <dependencies>
                        <dependency>
                            <groupId>jakarta.xml.bind</groupId>
                            <artifactId>jakarta.xml.bind-api</artifactId>
                            <version>2.3.3</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <jacocoReports>
                            <jacocoReport>${project.basedir}/jacoco-coverage-report/target/site/jacoco-aggregate/jacoco.xml</jacocoReport>
                        </jacocoReports>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <inherited>false</inherited>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <inherited>false</inherited>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <inherited>false</inherited>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.5</version>
            </plugin>
        </plugins>
    </build>

</project>
