<?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>com.sun.enterprise</groupId>
    <artifactId>hk2-parent</artifactId>
    <packaging>pom</packaging>

    <version>1.0.0</version>
    <name>Modules Subsystem</name>
    <description>Generic Modules subsystem</description>

    <organization>
        <name>Sun Microsystems, Inc.</name>
        <url>http://www.sun.com</url>
    </organization>

    <developers>
        <developer>
            <id>kohuske</id>
            <name>Kohsuke Kawaguchi</name>
            <url>http://weblogs.java.net/blog/kohsuke</url>
            <organization>Sun Microsystems, Inc.</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <id>dochez</id>
            <name>Jerome Dochez</name>
            <url>http://blogs.sun.com/dochez</url>
            <organization>Sun Microsystems, Inc.</organization>
            <roles>
                <role>lead</role>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <id>ss141213</id>
            <name>Sanjeeb Sahoo</name>
            <url>http://weblogs.java.net/ss141213</url>
            <organization>Sun Microsystems, Inc.</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <name>dev</name>
            <subscribe>https://hk2.dev.java.net/servlets/ProjectMailingListList</subscribe>
            <post>dev@hk2.dev.java.ne</post>
            <archive>https://hk2.dev.java.net/servlets/SummarizeList?listName=dev</archive>
        </mailingList>
        <mailingList>
            <name>users</name>
            <subscribe>https://hk2.dev.java.net/servlets/ProjectMailingListList</subscribe>
            <post>users@hk2.dev.java.net</post>
            <archive>https://glassfish.dev.java.net/servlets/SummarizeList?listName=users</archive>
        </mailingList>
        <mailingList>
            <name>issues</name>
            <subscribe>https://hk2.dev.java.net/servlets/ProjectMailingListList</subscribe>
            <post>issues@hk2.dev.java.net</post>
            <archive>https://hk2.dev.java.net/servlets/SummarizeList?listName=issues</archive>
        </mailingList>
        <mailingList>
            <name>commits</name>
            <subscribe>https://hk2.dev.java.net/servlets/ProjectMailingListList</subscribe>
            <post>commits@hk2.dev.java.net</post>
            <archive>https://hk2.dev.java.net/servlets/SummarizeList?listName=commits</archive>
        </mailingList>
    </mailingLists>

    <scm>
      <connection>scm:svn:https://hk2.dev.java.net/svn/hk2/tags/hk2-parent-1.0.0</connection>
    </scm>
    <distributionManagement>
        <site>
            <url>file:../www/</url>
        </site>
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>rator.sfbay</id>
            <url>dav:http://rator.sfbay/maven/repositories/glassfish/</url> 
        </repository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>glassfish-maven-repository</id>
            <name>Glassfish repository</name>
            <url>http://maven.glassfish.org/content/groups/glassfish-group/</url>
            <snapshots>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>glassfish-repository</id>
            <name>Glassfish repository</name>
            <url>http://download.java.net/maven/glassfish/</url>
            <snapshots>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>jvnet-maven2-repository</id>
            <name>Java.net maven2 repository</name>
            <url>http://download.java.net/maven/2/</url>
            <snapshots>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <sourceDirectory>src/java</sourceDirectory>
        <testSourceDirectory>test/java</testSourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <!--
                      execute release in the release profile to exclude test related modules
                      that don't need to be published.
                    -->
                    <arguments>-P release</arguments>
                </configuration>
            </plugin>
        </plugins>
        <extensions>
             <extension>
                  <groupId>org.apache.maven.wagon</groupId>
                  <artifactId>wagon-webdav</artifactId>
                  <version>1.0-beta-2</version>
             </extension>
        </extensions>
        <pluginManagement>
             <plugins>
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
                     <version>2.0.0</version>
                     <configuration>
                         <!-- By default, we don't export anything.
                         -->
                         <Export-Package />
                         <instructions>
                             <!-- Read all the configuration from osgi.bundle file, if it exists.
                                  See Felix-699 to find out why we use ${basedir}.
                             -->
                             <_include>-${basedir}/osgi.bundle</_include>
                         </instructions>
                     </configuration>
                 </plugin>
                <plugin>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>osgiversion-maven-plugin</artifactId>
                    <version>${project.version}</version>
                    <executions>
                        <execution>
                            <id>compute-osgi-version</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>compute-osgi-version</goal>
                            </goals>
                            <configuration>
                                <dropVersionComponent>qualifier</dropVersionComponent>
                                <versionPropertyName>project.osgi.version</versionPropertyName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
             </plugins>
        </pluginManagement>
    </build>

    <modules>
        <module>auto-depends</module>
        <module>apt</module>
        <module>core</module>
        <module>config</module>
        <module>config-generator</module>
        <module>external</module>
        <!--module>toy-http-server</module-->
        <module>hk2-maven</module>
        <module>hk2-maven-plugin</module>
        <module>osgi-adapter</module>
        <module>test-harness</module>
        <module>dependency-verifier</module>
        <module>dependency-visualizer</module>
        <module>osgiversion-maven-plugin</module>
        <module>osgi-main</module>
        <module>config-types</module>
        <module>consolidatedbundle-maven-plugin</module>
  </modules>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.3.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <!-- this profile is used during the development -->
            <id>debug</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>auto-depends-tests</module>
                <module>hk2</module>
            </modules>
        </profile>
        <profile>
            <!-- this profile is used when maven release plugin runs. see the mojo configuration above -->
            <id>release</id>
            <modules>
                <module>auto-depends-tests</module>
                <module>hk2</module>
            </modules>
        </profile>
        <profile>
            <!--
                The hk2 module depends on hk2-maven-plugin as an extension,
                so it causes a chicken and egg problem during a release;
                Maven tries to resolve all extensions early on, but it fails
                because the hk2-maven-plugin is not built yet.

                So the work around is a release in two-phase. First we
                do "mvn release:prepare", which fails due to the problem described above.
                At this point the workspace is left with POM that has non-SNAPSHOT version.
                So now we run "mvn -P release-phase1" and build the whole thing
                except the hk2 module. This puts maven-hk2-jar in local repo,
                so the retry of "mvn release:prepare" now works.
            -->
            <id>release-phase1</id>
        </profile>
    </profiles>

    <properties>
        <java.net.username>${user.name}</java.net.username>
    </properties>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <!--
                 Maven releaase process fails with NPE when a dependency report generation
                 tries to obtain a POM for the system-scope Artifact.
		 See MPIR-37 for the bug report. Kohsuke to file a bug report on this
		 with a proposed patch.
              -->
              <!--report>dependencies</report-->
              <report>project-team</report>
              <report>mailing-list</report>
              <report>cim</report>
              <report>issue-tracking</report>
              <report>license</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jxr-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
</project>
