<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.beangle</groupId>
  <artifactId>beangle-parent</artifactId>
  <packaging>pom</packaging>
  <version>4</version>
  <name>Beangle Software Parent</name>

  <description>
  The Beangle Software Group provides agile java/jvm based scaffold and toolkits.
  </description>

  <licenses>
    <license>
      <name>GNU Lesser General Public License</name>
      <url>http://www.gnu.org/licenses/lgpl.txt</url>
    </license>
  </licenses>

  <organization>
    <name>The Beangle Software Group</name>
    <url>https://github.com/beangle/beangle</url>
  </organization>

  <url>https://github.com/beangle/beangle</url>

	<scm>
		<connection>scm:git:git://github.com/beangle/beangle.git</connection>
		<developerConnection>scm:git:git@github.com:beangle/beangle.git</developerConnection>
		<url>https://github.com/beangle/beangle</url>
	  <tag>4</tag>
  </scm>
	
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <scala.version>2.9.2</scala.version>
    <scalatest.version>1.7.2</scalatest.version>
    <slf4j.version>1.6.4</slf4j.version>
    <logback.version>1.0.3</logback.version>
    <servletapi.version>2.4</servletapi.version>
    <junit.version>4.10</junit.version>
    <mockito.version>1.9.0</mockito.version>
    <spring.version>3.1.1.RELEASE</spring.version>
    <h2.version>1.3.166</h2.version>
    <testng.version>6.5.2</testng.version>
  </properties>
  
  <developers>
    <developer>
      <name>Tihua Duan</name>
      <id>chaostone</id>
      <email>duantihua at gmail.com</email>
      <roles>
        <role>Committer</role>
      </roles>
    </developer>
    <developer>
        <name>Jia Qian</name>
        <id>chanjarster</id>
        <email>chanjarster at gmail.com</email>
        <roles>
          <role>Contributor</role>
        </roles>
    </developer>
  </developers>
  
  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
       <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_2.9.2</artifactId>
        <version>${scalatest.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!--log-->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>${servletapi.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- jdbc driver -->
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>${h2.version}</version>
      </dependency>
      <!--osgi-->
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>osgi_R4_core</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>osgi_R4_compendium</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.2</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <args>
            <arg>-deprecation</arg>
            <arg>-unchecked</arg>
          </args>
          <jvmArgs>
            <jvmArg>-Xms200m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.3.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.3</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>1.7</version>
          </dependency>
        </dependencies>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <useReleaseProfile>false</useReleaseProfile>
          <arguments>-Pbeangle-release</arguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.9.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <useProjectReferences>true</useProjectReferences>
          <projectNameTemplate>[artifactId]</projectNameTemplate>
          <sourceIncludes>
            <sourceInclude>**/*.java</sourceInclude>
            <sourceInclude>**/*.scala</sourceInclude>
          </sourceIncludes>
           <!--<buildcommands>
            <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
          </buildcommands>
          -->
          <projectnatures>
            <projectnature>org.eclipse.jdt.core.javanature</projectnature>
            <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
          </projectnatures>
          <classpathContainers>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
            <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
          </classpathContainers>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
            <Bundle-Version>${project.version}</Bundle-Version>
            <Export-Package>!${bundle.namespace}*internal*,${bundle.namespace}.*;version="${project.version}"</Export-Package>
            <Private-Package>${bundle.namespace}*internal*</Private-Package>
            <Import-Package>*;resolution:=optional</Import-Package>
            <_include>-osgi.bnd</_include>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>  
        <artifactId>cobertura-maven-plugin</artifactId> 
        <version>2.5.1</version>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>**/model/**/*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <locales>zh_CN</locales>
          <outputEncoding>UTF-8</outputEncoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.1.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.12</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <aggregate>true</aggregate>
          <inputEncoding>UTF-8</inputEncoding>
          <outputEncoding>UTF-8</outputEncoding>
          <docTitle>Beangle ${project.version} Cross Reference</docTitle>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.7.1</version>
        <configuration>
          <rulesets>
            <ruleset>/rulesets/basic.xml</ruleset>
            <ruleset>/rulesets/imports.xml</ruleset>
            <ruleset>/rulesets/unusedcode.xml</ruleset>
            <ruleset>/rulesets/codesize.xml</ruleset>
            <ruleset>/rulesets/clone.xml</ruleset>
            <ruleset>/rulesets/coupling.xml</ruleset>
            <ruleset>/rulesets/strings.xml</ruleset>
            <!--<ruleset>/rulesets/naming.xml</ruleset>-->
            <ruleset>/rulesets/logging-java.xml</ruleset>
            <ruleset>/rulesets/logging-jakarta-commons.xml</ruleset>
            <!--<ruleset>/rulesets/optimizations.xml</ruleset>-->
            
            <ruleset>/rulesets/braces.xml</ruleset>
            <ruleset>/rulesets/design.xml</ruleset>
            <!--<ruleset>/rulesets/javabeans.xml</ruleset>-->
            <ruleset>/rulesets/strictexception.xml</ruleset>
            <!--<ruleset>/rulesets/controversial.xml</ruleset>
            <ruleset>/rulesets/finalizers.xml</ruleset>-->
          </rulesets>
          <reportSet>
            <reports>
              <report>pmd</report>
              <report>cpd</report>
            </reports>
          </reportSet>
          <linkXref>true</linkXref>
          <minimumTokens>100</minimumTokens>
          <targetJdk>1.5</targetJdk>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>beangle-release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <!--<inherited>false</inherited>-->
            <configuration>
              <links>
                <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
              </links>
              <charset>UTF-8</charset>
              <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
              <docletArtifact>
                <groupId>org.umlgraph</groupId>
                <artifactId>doclet</artifactId>
                <version>5.4</version>
              </docletArtifact>
              <additionalparam>-views</additionalparam>
              <useStandardDocletOptions>true</useStandardDocletOptions>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
