<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">
  <!-- ! Copyright (c) 2009 International Health Terminology Standards Development 
    Organisation ! ! 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. -->

  <modelVersion>4.0.0</modelVersion>
  <artifactId>snorocket-protege</artifactId>
  <packaging>jar</packaging>
  <name>Protege Plugin</name>

  <parent>
    <groupId>au.csiro</groupId>
    <artifactId>snorocket-parent</artifactId>
    <version>2.7.2</version>
    <relativePath>..</relativePath>
  </parent>
  
  <properties>
    <log4j.version>1.2.17</log4j.version>
  </properties>

  <dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>snorocket-owlapi</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.owlapi</groupId>
      <artifactId>owlapi-reasoner</artifactId>
      <version>${owl-api.version}</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.owlapi</groupId>
      <artifactId>owlapi-apibinding</artifactId>
      <version>${owl-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.protege</groupId>
      <artifactId>protege-editor-owl</artifactId>
      <version>${protege.version}</version>
    </dependency>
    <dependency>
      <groupId>org.protege</groupId>
      <artifactId>protege-editor-core-application</artifactId>
      <version>${protege.version}</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>bundle.version</name>
              <value>${project.version}</value>
              <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(-SNAPSHOT)?</regex>
              <replacement>$1.$2.$3</replacement>
              <failIfNoMatch>true</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/dist.xml</descriptor>
          </descriptors>
          <archive>
            <manifestFile>target/classes/META-MF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>stage-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>create-config-files</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>target</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/files</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <profiles>
	  <profile>
        <id>deploy-plugin</id>
        <activation>
          <property>
              <name>deployPlugin</name>
          </property>
        </activation>
		<build>
		  <plugins>
		    <plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>wagon-maven-plugin</artifactId>
				<version>1.0-beta-4</version>
				<configuration>
				  <serverId>plugin-repository</serverId>
				  <fromDir>target</fromDir>
				  <url>scp://ict-ehrclf-cbr.vm.csiro.au/srv/aehrc.com/apps/health_data/snorocket</url>
				  <includes>*with-dependencies.jar,about.html,update-owlapi3.properties</includes>
				</configuration>
				<executions>
				  <execution>
					<id>upload-plugin</id>
					<phase>deploy</phase>
					<goals>
					  <goal>upload</goal>
					</goals>
				  </execution>
				</executions>
			  </plugin>
		  </plugins>
	   </build>
      </profile>
	</profiles>

</project>

