<?xml version="1.0" encoding="UTF-8"?>
<!--
 *  Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
 *
 *  Licensed 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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.apache.tuscany</groupId>
    <artifactId>tuscany-project</artifactId>
    <version>incubating-M1</version>
    <packaging>pom</packaging>
    <name>Tuscany Project</name>
    <url>http://incubator.apache.org/tuscany/</url>
    <description>
        Tuscany is an open source project implementing a Service Component Architecture.
    </description>
    <inceptionYear>2005</inceptionYear>
    <organization>
        <name>Apache Software Foundation</name>
        <url>http://www.apache.org/</url>
    </organization>

    <prerequisites>
        <maven>2.0.4</maven>
    </prerequisites>

    <issueManagement>
        <system>jira</system>
        <url>http://issues.apache.org/jira/browse/TUSCANY</url>
    </issueManagement>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <repositories>
        <repository>
            <id>ibiblio</id>
            <name>ibiblio</name>
            <url>http://www.ibiblio.org/maven2</url>
        </repository>
    </repositories>

    <modules>
        <module>buildtools</module>
        <module>spec</module>
        <module>sdo</module>
        <module>das</module>
        <module>sca</module>
        <module>samples</module>
        <module>sampleapps</module>
    </modules>

    <distributionManagement>
       <!--
        <snapshotRepository>
           <id>maven-snapshot-repository</id>
           <name>Apache SNAPSHOT Repository</name>
           <url>scpexe://cvs.apache.org/www/cvs.apache.org/maven-snapshot-repository</url>
        </snapshotRepository>
        -->
        <repository>
            <id>maven-test-repository</id>
            <name>Test Repository</name>
            <url>scp://people.apache.org/home/jsdelfino/public_html/maven2</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
                            <Implementation-URL>http://incubator.apache.org/tuscany/</Implementation-URL>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.componentType</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.componentType</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <defaultGoal>install</defaultGoal>

        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>1.0-alpha-5</version>
            </extension>
        </extensions>


        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.tuscany</groupId>
                            <artifactId>tuscany-buildtools</artifactId>
                            <version>${pom.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>process-sources</id>
                            <phase>process-sources</phase>
                            <configuration>
                                <configLocation>tuscany-checkstyle.xml</configLocation>
                                <consoleOutput>true</consoleOutput>
                                <failsOnError>true</failsOnError>
                                <linkXRef>false</linkXRef>
                                <sourceDirectory>${basedir}/src</sourceDirectory>
                                <propertyExpansion>
                                ${checkstyle.properties}
                                </propertyExpansion>
                            </configuration>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>


    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/tuscany/java</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/tuscany/java</developerConnection>
        <url>http://svn.apache.org/viewcvs.cgi/incubator/tuscany/java</url>
    </scm>


    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>


    <profiles>
        <profile>
            <!-- basic profile with no checks or anything... -->
            <id>basic</id>
        </profile>

        <profile>
            <id>sourcecheck</id>
            <!--
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            -->
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>1.5</source>
                            <target>1.5</target>
                            <showDeprecation>true</showDeprecation>
                            <compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>
        <profile>
            <id>distribution</id>

            <activation>
                <property>
                    <name>tuscany.home</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>1.5</source>
                            <target>1.5</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
			<version>2.0</version>
                        <executions>
                            <execution>
                                <id>package</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
				<links>
					<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
				</links>
				<offlineLinks>
					<offlineLink>
						<url>../sca-api</url>
						<location>${tuscany.home}/spec/sca/target/site/apidocs</location>
					</offlineLink>
					<offlineLink>
						<url>../sdo-api</url>
						<location>${tuscany.home}/spec/sdo/target/site/apidocs</location>
					</offlineLink>
					<offlineLink>
						<url>../tuscany-common</url>
						<location>${tuscany.home}/sca/common/target/site/apidocs</location>
					</offlineLink>
					<offlineLink>
						<url>../tuscany-model</url>
						<location>${tuscany.home}/sca/model/target/site/apidocs</location>
					</offlineLink>
					<offlineLink>
						<url>../tuscany-core</url>
						<location>${tuscany.home}/sca/core/target/site/apidocs</location>
					</offlineLink>
					<offlineLink>
						<url>../tuscany-databinding-sdo</url>
						<location>${tuscany.home}/sca/databinding/sdo/target/site/apidocs</location>
					</offlineLink>
				</offlineLinks>
                            <!--
                            <outputDirectory>${tuscany.home}/distribution/build/javadoc/${project.artifactId}</outputDirectory>
                            -->
                            <attach>true</attach>
                            <quiet>true</quiet>
                            <bottom>-</bottom>
                            <header>${project.name}</header>
                            <footer>${project.name}</footer>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-dist</id>
                                <phase>install</phase>
                                <configuration>
                                    <tasks>
                                        <ant inheritRefs="true"
                                            antfile="${tuscany.home}/distribution/buildDistribution.xml" dir="${tuscany.home}"
                                            target="createDistribution">
                                            <property name="dist.folder"
                                                value="${tuscany.home}/distribution/build" />
                                            <property
                                                name="project.packaging" value="${project.packaging}" />
                                            <property
                                                name="project.groupId" value="${project.groupId}" />
                                            <property
                                                name="project.artifactId" value="${project.artifactId}" />
                                            <property
                                                name="project.version" value="${project.version}" />
                                            <property
                                                name="project.basedir" value="${basedir}" />
                                        </ant>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>clean-dist</id>
                                <phase>clean</phase>
                                <configuration>
                                    <tasks>
                                        <ant inheritRefs="true"
                                            antfile="${tuscany.home}/distribution/buildDistribution.xml" dir="${tuscany.home}"
                                            target="cleanDistribution">
                                            <property name="dist.folder"
                                                value="${tuscany.home}/distribution/build" />
                                            <property
                                                name="project.packaging" value="${project.packaging}" />
                                            <property
                                                name="project.groupId" value="${project.groupId}" />
                                            <property
                                                name="project.artifactId" value="${project.artifactId}" />
                                            <property
                                                name="project.version" value="${project.version}" />
                                            <property
                                                name="project.basedir" value="${basedir}" />
                                        </ant>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>

                        </executions>
                    </plugin>
                </plugins>

                <resources>
                    <resource>
                        <directory>.</directory>
                        <includes>
                            <include>README.txt</include>
                            <include>LICENSE.txt</include>
                        </includes>
                    </resource>
                </resources>
            </build>
        </profile>
    </profiles>
</project>
