<?xml version="1.0" encoding="UTF-8"?>
<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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.code-visual</groupId>
    <artifactId>visual-flowengine-spring-boot-starter</artifactId>
    <version>1.0.1</version>
    <packaging>jar</packaging>
    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git@github.com:code-visual/visual-flowengine-spring-boot-starter.git</connection>
        <developerConnection>scm:git@github.com:code-visual/visual-flowengine-spring-boot-starter.git</developerConnection>
        <url>git@github.com:code-visual/visual-flowengine-spring-boot-starter.git</url>
    </scm>

    <developers>
        <developer>
            <name>levi</name>
            <email>levi.lideng@gmail.com</email>
            <organization>code-visual</organization>
            <organizationUrl>https://www.ikuning.com</organizationUrl>
            <url>https://www.ikuning.com</url>
        </developer>
    </developers>

    <name>visual-flowengine Application</name>
    <description>visual-flowengine</description>
    <url>https://www.ikuning.com</url>
<!--    <distributionManagement>-->
<!--        <snapshotRepository>-->
<!--            <id>ossrh</id>-->
<!--            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>-->
<!--        </snapshotRepository>-->
<!--        <repository>-->
<!--            <id>ossrh</id>-->
<!--            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>-->
<!--        </repository>-->
<!--    </distributionManagement>-->


    <dependencies>
        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>4.0.15</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <version>2.6.3</version>
            <scope>provided</scope>
        </dependency>


        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>2.6.3</version>
            <scope>provided</scope>
        </dependency>
        <!-- Maven依赖 -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.9</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.2.25.RELEASE</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.7.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            <version>2.7.11</version>
        </dependency>


    </dependencies>
    <build>
        <plugins>
            <!--            https://github.com/groovy/GMavenPlus/wiki/Examples-->
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>addSources</goal>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>Copyright config</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <scripts>
                                <script>
                                    <![CDATA[
void addCopyright(String path, String extension) {
println("path: " + path)
    def directory = new java.io.File(path)
    directory.eachFileRecurse(groovy.io.FileType.FILES) { file ->
        if (file.name.endsWith(extension)) {
            def content = file.text
            if (!content.contains("Copyright")) {
                def newContent = "/*\n" +
                    " * Copyright (c) 2023-2024, levi li (levi.lideng@gmail.com)\n" +
                    " *\n" +
                    " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
                    " * you may not use this file except in compliance with the License.\n" +
                    " * You may obtain a copy of the License at\n" +
                    " *\n" +
                    " *      https://www.apache.org/licenses/LICENSE-2.0\n" +
                    " *\n" +
                    " * Unless required by applicable law or agreed to in writing, software\n" +
                    " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
                    " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
                    " * See the License for the specific language governing permissions and\n" +
                    " * limitations under the License.\n" +
                    " */\n" + content
                file.text = newContent
            }
        }
    }
}

addCopyright(project.basedir.toString() + "/src/main/java", ".java")
addCopyright(project.basedir.toString() + "/src/main/groovy", ".groovy")
                        ]]>
                                </script>
                            </scripts>
                        </configuration>
                    </execution>

                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.3.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <tokenAuth>true</tokenAuth>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>