<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.wso2.codegen</groupId>
    <artifactId>wso2codegen</artifactId>
    <packaging>jar</packaging>
    <version>2.15</version>
    <name>wso2codegen</name>
    <url>http://www.wso2.org</url>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>codegen-pom.xsl</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>codegen-pom.xsl</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <source>1.4</source>
                    <target>1.4</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.2</version>
            </plugin>
          
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.0.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <inherited>false</inherited>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/generated</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>aar</id>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <copy tofile="target/wso2codegen-${wso2codegen.version}.aar"
                                      file="target/wso2codegen-${wso2codegen.version}.jar"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <java classname="org.wso2.utils.codegen.CodegenHelper"
                                      fork="true">
                                    <arg value="src/main/resources/codegen.xml"/>
                                    <classpath refid="maven.dependency.classpath"/>
                                    <classpath refid="maven.compile.classpath"/>
                                    <classpath refid="maven.runtime.classpath"/>
                                </java>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>copy-code</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/target/generated</source>
                            </sources>
                        </configuration>
                    </execution>

                    <execution>
                        <id>aar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/wso2codegen-${wso2codegen.version}.aar</file>
                                    <type>aar</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-1</version>
                <executions>
                    <execution>
                        <id>ui-package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/bin.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.wso2.utils</groupId>
            <artifactId>wso2utils</artifactId>
            <version>${wso2utils.version}</version>
        </dependency>

        <dependency>
            <groupId>org.wso2.dynamiccodegen</groupId>
            <artifactId>wso2dynamic-codegen</artifactId>
            <version>${dynamiccodegen.version}</version>
        </dependency>
        <!-- Axis2 Jars -->
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2</artifactId>
            <version>${axis2.version}</version>
        </dependency>

        <!-- AIOM Dependencies -->
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-impl</artifactId>
            <version>${axiom.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-api</artifactId>
            <version>${axiom.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-dom</artifactId>
            <version>${axiom.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.neethi</groupId>
            <artifactId>neethi</artifactId>
            <version>${neethi.version}</version>
        </dependency>


        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>${commons.logging.version}</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>${commons.httpclient.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>${httpcore.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.woden</groupId>
            <artifactId>woden-api</artifactId>
            <version>${woden.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.woden</groupId>
            <artifactId>woden-impl-dom</artifactId>
            <version>${woden.version}</version>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>${wsdl4j.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>${javamail.version}</version>
        </dependency>
        <dependency>
            <groupId>xmlbeans</groupId>
            <artifactId>xbean</artifactId>
            <version>${xbean.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons.schema</groupId>
            <artifactId>XmlSchema</artifactId>
            <version>${XmlSchema.version}</version>
        </dependency>
        <!--for java2wsdl generation we use JAM , so there should be a dependency on the annogen jar or-->
        <!--XML Beans-->

        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>${ant.version}</version>
        </dependency>


        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>${xalan.version}</version>
        </dependency>

        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1-beta-10</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>wstx-asl</artifactId>
            <version>3.2.1</version>
        </dependency>
        
    </dependencies>

    <repositories>
        <repository>
            <id>maven-snapshots</id>
            <name>Maven Central Development Repository</name>
            <url>http://snapshots.maven.codehaus.org/maven2</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>wso2-maven2-repository</id>
            <url>http://dist.wso2.org/maven2</url>
        </repository>
        <repository>
            <id>m2-snapshot-repository</id>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>ws-zones-repository</id>
            <url>http://ws.zones.apache.org/repository2</url>
        </repository>
        <!-- Others are available from http://repo1.maven.org/maven2 -->
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>snapshot-apache</id>
            <name>Apache Snapshot repository</name>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>

        <pluginRepository>
            <id>snapshot</id>
            <name>Snapshot repository</name>
            <url>http://snapshots.maven.codehaus.org/maven2</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>

    </pluginRepositories>

    <profiles>
         <profile>
             <activation>
                 <property>
                     <name>sign</name>
                 </property>
             </activation>
             <build>
                 <plugins>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-gpg-plugin</artifactId>
                         <version>1.0-alpha-3</version>
                         <executions>
                             <execution>
                                 <id>sign-artifacts</id>
                                 <phase>verify</phase>
                                 <goals>
                                     <goal>sign</goal>
                                 </goals>
                             </execution>
                         </executions>
                     </plugin>
                 </plugins>
             </build>
         </profile>
     </profiles>
        

    <distributionManagement>
        <repository>
            <id>wso2-maven2-repository</id>
            <name>WSO2 Maven2 Repository</name>
            <url>scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>wso2-maven2-snapshot-repository</id>
            <name>WSO2 Maven2 Repository</name>
            <url>scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- Properties are using in pom.xml as well as to filter codegen-pom.xml-->
        <axis2.version>1.35</axis2.version>
        <wso2codegen.version>${pom.version}</wso2codegen.version>
        <wso2utils.version>2.15</wso2utils.version>
        <dynamiccodegen.version>2.15</dynamiccodegen.version>
        <neethi.version>2.0.3</neethi.version>
        <rampart.version>1.35</rampart.version>
        <axiom.version>1.2.6</axiom.version>
        <XmlSchema.version>1.3.3</XmlSchema.version>
        <xbean.version>2.1.0</xbean.version>

        <woden.version>0.95</woden.version>
        <wsdl4j.version>1.6.1</wsdl4j.version>
        <annogen.version>0.1.0</annogen.version>

        <javamail.version>1.4</javamail.version>

        <xmlsec.version>1.3.0</xmlsec.version>

        <commons.httpclient.version>3.0.1</commons.httpclient.version>
        <commons.logging.version>1.1</commons.logging.version>

        <junit.version>3.8.2</junit.version>
        <log4j.version>1.2.13</log4j.version>

        <httpcore.version>4.0-alpha5</httpcore.version>
        <ant.version>1.7.0</ant.version>
        <xalan.version>2.7.0</xalan.version>
    </properties>
</project>
