<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you 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">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.openjpa</groupId>
  <artifactId>openjpa-slice</artifactId>
  <packaging>jar</packaging>
  <version>0.4.0</version>
  <name>Slice</name>
  <description>Distributed Persistence Service using OpenJPA</description>
  <url>http://people.apache.org/~ppoddar/slice/site/index.html</url>
  <inceptionYear>2007</inceptionYear>
   <developers>
         <developer>
            <name>Pinaki Poddar</name>
            <id>ppoddar</id>
            <organization>BEA Systems, Inc.</organization>
            <email>ppoddar@bea.com</email>
        </developer>
  	</developers>
    <contributors>
  	</contributors>
  	<mailingLists>
  	  <mailingList>
  	     <name>Mailing List</name>
         <subscribe>labs-subscribe@labs.apache.org</subscribe>
         <unsubscribe>labs-unsubscribe@labs.apache.org</unsubscribe>
      </mailingList>
    </mailingLists>
    
  	<scm>
        <connection>scm:svn:http://${scm.dir}</connection>
        <developerConnection>scm:svn:https://${scm.dir}</developerConnection>
        <url>https://${scm.dir}</url>
  	</scm>
  	
    <organization>
        <name>Apache Software Labs</name>
        <url>http://labs.apache.org</url>
    </organization>
  
  
  <properties>
        <scm.dir>svn.apache.org/repos/asf/labs/fluid/slice</scm.dir>
        <javadoc.output.dir>src/site/resources</javadoc.output.dir>
        <docbook.source>${project.basedir}/src/doc</docbook.source>
        <docbook.target>${project.basedir}/src/site/resources</docbook.target>
        <docbook.version>1.67.2</docbook.version>
        <parent.site.docs>${project.basedir}/target/site</parent.site.docs>
  </properties>
  
  <repositories>
        <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <url>http://www.ibiblio.org/maven2</url>
        </repository>
        <repository>
            <id>maven-central</id>
            <name>Maven Plugin Repository</name>
            <url>http://repo1.maven.org</url>
        </repository>
        <repository>
            <id>apache-snapshots</id>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
        </repository>
  </repositories>
    
  <dependencies>
    <dependency>
      <groupId>org.apache.openjpa</groupId>
      <artifactId>openjpa</artifactId>
      <version>1.1.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.0.4</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test-compile</scope>
    </dependency>
    
  </dependencies>
  
  
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <fork>true</fork>
                </configuration>
            </plugin>
             <plugin>
        		<groupId>org.apache.maven.plugins</groupId>
        		<artifactId>maven-surefire-plugin</artifactId>
        		<configuration>
                    <fork>true</fork>
                    <disableXmlReport>true</disableXmlReport>
                    <trimStackTrace>true</trimStackTrace>
                </configuration>
      		</plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <configuration>
                    		<fork>true</fork>
                            <tasks>
                                <path id="enhance.class.path">
                                    <path refid="maven.test.classpath"/>
                                    <path refid="maven.compile.classpath"/>
                                    <path refid="maven.dependency.classpath"/>
                                </path>
                                <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
                                    <classpath refid="enhance.class.path"/>
                                </taskdef>
                                <fileset id="enhance.path.ref"
                                    dir="${project.build.testOutputDirectory}">
                                    <include name="test/domain/*.class"/>
                                </fileset>
                                <echo message="Enhancing Test Entities"/>
                                <openjpac>
                                    <classpath refid="enhance.class.path"/>
                                    <fileset refid="enhance.path.ref"/>
                                    <config log="DefaultLevel=WARN, Enhance=INFO"/>
                                </openjpac>
                           </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    
                    <execution>
                        <id>set subversion revision</id>
                        <phase>compile</phase>
                        <configuration>
                            <tasks>
                                <property name="outdir"                value="${project.build.outputDirectory}"/>
                                <property name="svnversion.executable" value="svnversion"/>
                                <exec outputproperty="subversion.revision"
                                    failonerror="false"
                                    failifexecutionfails="false"
                                    executable="${svnversion.executable}">
                                    <arg line="-c ${basedir}"/>
                                </exec>
                                <property name="subversion.revision" value="unknown"/>
                                <echo>Revision: ${subversion.revision}</echo>
                                <echo>Slice version: ${project.version}</echo>
                                    
                                <mkdir dir="${outdir}/META-INF"/>
                                <echo file="${outdir}/META-INF/org.apache.openjpa.slice.revision.properties">slice.version=${project.version}
revision.number=${subversion.revision}</echo>

                              </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                           <mainClass>org.apache.openjpa.slice.SliceVersion</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            
        </plugins>
    </build>  
    
    
    <profiles>    
        <profile>
            <!--                        
                Javadoc profile. Docs can be built by running:
                    mvn process-classes -Dtest=false -Pjavadoc-profile
            -->  
            <id>javadoc-profile</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.2</version>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <goals><goal>javadoc</goal></goals>
                                <configuration>
                                    <outputDirectory>${javadoc.output.dir}</outputDirectory>
                                    <reportOutputDirectory>${javadoc.output.dir}</reportOutputDirectory>
                                    <additionalparam>
                                        ${javadoc.additionalparam}
                                    </additionalparam>
                                    <aggregate>true</aggregate>
                                    <verbose>false</verbose>
                                    <noqualifier>all</noqualifier>
                                    <!-- <linksource>true</linksource> -->
                                    <maxmemory>512m</maxmemory>
                                    <links>
                                        <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
                                        <link>http://java.sun.com/javaee/5/docs/api</link>
                                        <link>http://jakarta.apache.org/commons/collections/api-release</link>
                                    </links>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <activation>
                <property>
                    <name>builddocs</name>
                    <value>true</value>
                </property>
            </activation>
        </profile>
        
        <!-- ===============================================================
            Docbook profile. Docs can be built by running:
            MAVEN_OPTS=-Xmx512m
            mvn process-resources -Pdocbook-profile
        ==================================================================== -->
        
          <profile>
            <id>docbook-profile</id>
            <build>
                <plugins>
                    <!-- build the docs when processing resources -->
                    <plugin>
                        <groupId>com.agilejava.docbkx</groupId>
                        <artifactId>docbkx-maven-plugin</artifactId>
                        <executions>
                             <execution>
                                <id>build-pdf-doc</id>
                                <phase>process-resources</phase>
                                <goals><goal>generate-pdf</goal></goals>
                                <configuration>
                                    <sourceDirectory>${docbook.source}</sourceDirectory>
                                    <targetDirectory>${docbook.target}</targetDirectory>
                                    <includes>slice.xml</includes>
                                    <foCustomization>${docbook.source}/manual-pdf.xsl</foCustomization>
                                    <imgSrcPath>${docbook.source}/</imgSrcPath>
                                </configuration>
                            </execution>
                            <!-- No chunked document for now 
                            <execution>
                                <id>build-chunked-doc</id>
                                <phase>process-resources</phase>
                                <goals><goal>generate-html</goal></goals>
                                <configuration>
                                    <sourceDirectory>${docbook.source}</sourceDirectory>
                                    <targetDirectory>${docbook.target}</targetDirectory>
                                    <includes>slice.xml</includes>
                                    <chunkedOutput>true</chunkedOutput>
                                    <chunkQuietly>false</chunkQuietly>
                                    <htmlCustomization>${docbook.source}/manual-xhtml-chunk.xsl</htmlCustomization>
                                    <postProcess>
                                        
                                        <mkdir dir="${docbook.target}/images"/>
                                        <copy todir="${docbook.target}/images">
                                            <fileset dir="${docbook.source}/images">
                                                <include name="*.*"/>
                                            </fileset>
                                        </copy>

                                        <mkdir dir="${docbook.target}/css"/>
                                        <copy todir="${docbook.target}/css">
                                            <fileset dir="${docbook.source}/css">
                                                <include name="*.*"/>
                                            </fileset>
                                        </copy>
                                    </postProcess>
                                </configuration>
                            </execution>
                            No chunked document for now --> 
                            <execution>
                                <id>build-single-doc</id>
                                <phase>process-resources</phase>
                                <goals><goal>generate-html</goal></goals>
                                <configuration>
                                    <sourceDirectory>${docbook.source}</sourceDirectory>
                                    <targetDirectory>${docbook.target}</targetDirectory>
                                    <includes>slice.xml</includes>
                                    <chunkedOutput>false</chunkedOutput>
                                    <htmlCustomization>${docbook.source}/manual-xhtml.xsl</htmlCustomization>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                        <dependency>
                            <groupId>org.docbook</groupId>
                            <artifactId>docbook-xml</artifactId>
                            <version>4.4</version>
                            <scope>runtime</scope>
                        </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <activation>
                <property>
                    <name>builddocs</name>
                    <value>true</value>
                </property>
            </activation>
            <pluginRepositories>
                <pluginRepository>
                    <id>agilejava</id>
                    <name>Agilejava repository (Docbook plugin)</name>
                    <url>http://agilejava.com/maven</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        
     </profiles>
     
     <distributionManagement>
  	<!-- use the following if you're not using a snapshot version. -->
  		<!-- repository>
    		<id>repo</id>
    			<name>Repository Name</name>
    			<url>scp://host/path/to/repo</url>
  		</repository -->
  		<!-- use the following if you ARE using a snapshot version. -->
  		<snapshotRepository>
    		<id>fluid.snapshot.repo</id>
    		<name>Slice Snapshot Repository</name>
    		<url>scp://svn.apache.org/repos/asf/labs/fluid/slice</url>
  		</snapshotRepository>
     	<site>
      		<id>slice.website</id>
         		<!-- Set to the deployment URL on your own server. -->
         	<url>scp://people.apache.org/home/ppoddar/public_html/slice/site/</url>
      	</site>
	</distributionManagement>
     

   <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
            <stylesheet>maven</stylesheet>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
                  <reportSets>
                     <reportSet>
                        <reports>
      <!-- No stock reports for now 
                           <report>dependencies</report>
                           <report>project-team</report>
                           <report>mailing-list</report>
                           <report>scm</report>
       no reports for now -->
                        </reports>
                     </reportSet>
                  </reportSets>
      </plugin>
    </plugins>
  </reporting>
</project>