<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.lorislab.maven</groupId>
    <artifactId>jpa2-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <version>1.0.7-SNAPSHOT</version>
    <name>jpa2-maven-plugin</name>
    <description>JPA2 maven plugin</description>
    <url>http://www.lorislab.org</url>
    
	
    <scm>
        <connection>scm:git:https://github.com/lorislab/jpa2-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:lorislab/jpa2-maven-plugin.git</developerConnection>
        <url>https://github.com/lorislab/jpa2-maven-plugin</url>
        <tag>HEAD</tag>
    </scm>
		
    <prerequisites>
        <maven>2.2.1</maven>
    </prerequisites>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    
    <developers>
        <developer>
            <id>andrej</id>
            <email>andrej@lorislab.org</email>
            <organization>lorislab.org</organization>
        </developer>
    </developers>
        
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>        
    </properties>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>3.0.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <scope>compile</scope>
                <version>3.4</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>3.2.2</version>
                <type>jar</type>
            </dependency>
            <!-- HIBERNATE -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>5.0.1.Final</version>
            </dependency>            
            <!-- SPEC -->
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.1-api</artifactId>
                <version>1.0.0.Final</version>
            </dependency>
            <!-- DB -->
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.3.3</version>
            </dependency>                         		
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- SPEC -->
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <scope>provided</scope>
        </dependency>       
        <!-- DB -->
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
        </dependency>                             			
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>		
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <inherited>true</inherited>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <inherited>true</inherited>
                <configuration>
                    <excludePackageNames>org.lorislab.maven.jpa2.persistence.jpa21</excludePackageNames>
                    <aggregate>true</aggregate>
                    <links>
                        <link>http://docs.oracle.com/javase/8/docs/api/</link>
                    </links>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-URL>${project.url}</Implementation-URL>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>					
        </plugins>
    </build>
	
    <distributionManagement>
        <repository>
            <id>bintray</id>
            <url>https://api.bintray.com/maven/lorislab/maven/jpa2-maven-plugin/;publish=1</url>
        </repository>
    </distributionManagement>

    <profiles>  
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>              
        <profile>
            <id>generated</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-xjc-plugin</artifactId>
                        <version>3.0.4</version>  
                        <executions>
                            <execution>
                                <id>generate-sources-21</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>xsdtojava</goal>
                                </goals>
                                <configuration>
                                    <sourceRoot>src/main/java</sourceRoot>
                                    <schemaDirectory>src/main/resources/xsd</schemaDirectory>
                                    <xsdOptions>                                                
                                        <xsdOption>
                                            <packagename>org.lorislab.maven.release.persistence.jpa21</packagename>
                                            <xsd>src/main/resources/xsd/persistence_2_1.xsd</xsd>
                                        </xsdOption>
                                    </xsdOptions>
                                </configuration>                                
                            </execution>                                                                                                             
                        </executions>
                    </plugin>
                </plugins>
            </build>            
        </profile>
    </profiles>
    		
</project>
