<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>

    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>22</version>
        <relativePath />
    </parent>

    <groupId>org.jboss.windup.web.plugin</groupId>
    <artifactId>windup-tsmodelsgen-maven-plugin</artifactId>
    <version>4.2.0.Final</version>
    <packaging>maven-plugin</packaging>

    <name>Windup Web - TS Model Generator Maven Plugin</name>

    <url>http://windup.jboss.org/</url>

    <licenses>
        <license>
            <name>Eclipse Public License version 1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <version.windup.core>4.2.0.Final</version.windup.core>
        <!-- this property is used in the code too, DO NOT REMOVE IT! -->
        <version.windup.web>4.2.0.Final</version.windup.web>
        <!-- For now, we need to pass this to the Mojo explicitly (through META-INF/versions.properties),
             but it should be possible to figure that out from the Windup POM. -->
        <version.forge>3.7.2.Final</version.forge>
        <version.furnace>2.26.2.Final</version.furnace>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.windup</groupId>
                <artifactId>windup-bom</artifactId>
                <version>${version.windup.core}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.windup.rules</groupId>
                <artifactId>windup-rulesets</artifactId>
                <version>${version.windup.core}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- Maven plugin API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.3.9</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>3.3.9</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.0.24</version>
        </dependency>
        <!-- Logging and tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>



        <!-- Windup dependencies -->

        <!-- This should be the addon which contains all the core Windup dependencies you need to run Windup. -->
        <dependency>
            <groupId>org.jboss.windup</groupId>
            <artifactId>windup-tooling</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>
        <!-- But it isn't. The needed rest is referenced as deps in bootstrap. -->
        <dependency>
            <groupId>org.jboss.windup</groupId>
            <artifactId>windup-bootstrap</artifactId>
        </dependency>

        <!-- TypescriptModelsGeneratingService -->
        <dependency>
            <groupId>org.jboss.windup.web.addons</groupId>
            <artifactId>windup-web-support-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Furnace -->
        <dependency>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-se</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.forge.furnace.container</groupId>
            <!-- Windup switched from :cdi to :simple due to problems with Titan classloading. -->
            <artifactId>simple</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>

        <!-- Forge -->
        <dependency>
            <groupId>org.jboss.forge.addon</groupId>
            <artifactId>core</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>
    </dependencies>

    <build>
        <!-- Bundle beans.xml and version.properties. -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <!-- <version>3.5</version> -->
                <configuration>
                    <goalPrefix>windup-tsmodelsgen</goalPrefix>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>generatePluginDescriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>runPlugin</id>
            <build>
                <plugins>
                    <!-- Run the Windup TS Models Generator plugin. Needs to run after this project is built first. -->
                    <plugin>
                        <groupId>org.jboss.windup.web.plugin</groupId>
                        <artifactId>windup-tsmodelsgen-maven-plugin</artifactId>
                        <version>${project.version}</version>
                        <configuration>
                            <outputDir>target/tsModels</outputDir>
                            <adjacencyMode>DECORATED</adjacencyMode>
                            <!-- For import {...} from '../../src/main/webapp/'
                            <importPathToWebapp>../..</importPathToWebapp>
                            -->
                        </configuration>
                        <executions>
                            <execution>
                                <id>generateTSmodels</id>
                                <phase>generate-sources</phase>
                                <goals> <goal>tsmodelgen</goal> </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Development purposes, to see how the archive is created.
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.0.2</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals> <goal>jar</goal> </goals>
                                <configuration>
                                    <classesDirectory>target</classesDirectory>
                                    <classifier>models</classifier>
                                    <archive>
                                        <addMavenDescriptor>false</addMavenDescriptor>
                                    </archive>
                                    <includes>
                                        <include>tsModels/**</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    -->
                </plugins>
            </build>
        </profile>
        <profile>
            <id>run-integration-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>2.0.0</version>
                        <configuration>
                            <debug>true</debug>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <pomIncludes>
                                <pomInclude>*/pom.xml</pomInclude>
                            </pomIncludes>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <goals>
                                <goal>clean</goal>
                                <goal>test-compile</goal>
                            </goals>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

  <scm>
    <tag>4.2.0.Final</tag>
  </scm>
</project>
