<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>de.mhus.sling.vaadin</groupId>
  <artifactId>VaadinSling</artifactId>
  <version>1.0.1</version>
  <packaging>bundle</packaging>
  <name>Vaadin Sling Adapter</name>
  <description>Adapter to develop and use Vaadin application inside the Apache-Sling framework</description>
  <url>http://www.mhus.de</url>
  <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>
  <scm>
    <url>https://github.com/mhus/vaadinsling/tree/master/VaadinSling</url>
    <connection>scm:git:https://github.com/mhus/vaadinsling.git</connection>
  </scm>
  <developers>
    <developer>
      <id>mhu</id>
      <name>Mike Hummel</name>
      <email>mh@mikehummel.de</email>
      <url>http://www.mhus.de</url>
    </developer>
  </developers>
    
  <properties>
    <!-- define default encoding for all source/resource files -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  
  <build>
  
      <resources>
      <resource>
        <directory>src/main/webapp/SLING-CONTENT</directory>
        <targetPath>SLING-CONTENT</targetPath>
        <filtering>false</filtering>
      </resource>
      </resources>
  
    <plugins>
<!-- 
	<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
 -->      
 <plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-release-plugin</artifactId>
	<version>2.2.2</version>
	<configuration>
		<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
	</configuration>
</plugin>

	<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      
      <!-- Eclipse configuration -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <downloadSources>true</downloadSources>
          <useProjectReferences>false</useProjectReferences>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                      <Export-Package>de.mhus.sling.vaadin</Export-Package>  
<!--                          <Embed-Dependency>bsh;inline=true</Embed-Dependency>  -->
		        <Import-Package>
		           org.osgi.*;resolution:=optional
			</Import-Package> 
			<DynamicImport-Package>*</DynamicImport-Package>
					<Bundle-Activator>de.mhus.sling.vaadin.servlet.CoreActivator</Bundle-Activator>
                    </instructions>
<!--                     <wrapImportPackage>;</wrapImportPackage>  -->
                </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>maven-sling-plugin</artifactId>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <wtpversion>1.5</wtpversion>
        </configuration>
      </plugin>
 
    </plugins>

    <!-- plugin management -->
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.8</version>
        </plugin>

        <plugin>
          <groupId>org.apache.sling</groupId>
          <artifactId>maven-sling-plugin</artifactId>
          <version>2.0.4-incubator</version>
		      <!-- Default configuration for deploying bundles into running CQ instance -->
          <configuration>
            <slingUrl>http://localhost:8080/system/console</slingUrl>
            <user>admin</user>
            <password>admin</password>
          </configuration>
          <executions>
            <!-- Specify that the maven validate task automatically incorporates the use of the maven-sling-plugin to validate 
              the JSON files contained in a bundle. Validation can be skipped by setting system property 'sling.validation.skip' to true. -->
            <execution>
              <id>validate-bundle</id>
              <goals>
                <goal>validate</goal>
              </goals>
            </execution>
            <!-- Specify that the maven install task automatically incorporates the use of the maven-sling-plugin to deploy 
              resulting bundles directly to a running Sling-instance Install to sling instance can be skipped by setting system property 
              'sling.install.skip' to true. -->
            <execution>
              <id>install-bundle</id>
              <goals>
                <goal>install</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.0.1</version>
          <!-- Allow the plugin to extend maven with the 'bundle' packaging target -->
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <Sling-Initial-Content>SLING-CONTENT;overwrite:=true</Sling-Initial-Content>
            </instructions>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-scr-plugin</artifactId>
          <version>1.7.4</version>
          <executions>
            <!-- The scr goal is bound to the generate-resources phase and will generate a single descriptor file as well 
              as meta type file for all components found in the project. -->
            <execution>
              <id>generate-scr-scrdescriptor</id>
              <goals>
                <goal>scr</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>
    <extensions>
    </extensions>

  </build>

  <dependencyManagement>
    <dependencies>

      <!-- Web Application API -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
      </dependency>

      <!-- Apache Commons Lang -->
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
      </dependency>

      <!-- Felix SCR annotations -->
      <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.scr.annotations</artifactId>
        <scope>compile</scope>
        <version>1.6.0</version>
      </dependency>

      <!-- Sling API -->
      <dependency>
        <groupId>org.apache.sling</groupId>
        <artifactId>org.apache.sling.api</artifactId>
        <version>2.2.0</version>
      </dependency>

      <!-- OSGI -->
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>4.1.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
        <version>4.1.0</version>
        <scope>provided</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>
  
    <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.scr.annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.servlets.post</artifactId>
      <version>2.1.0</version>
    </dependency>
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.commons.osgi</artifactId>
      <version>2.0.6</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
    <!-- slf4j -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.5.0</version>
    </dependency>
    
    <dependency>
    	<groupId>com.vaadin</groupId>
    	<artifactId>vaadin</artifactId>
    	<version>6.8.0</version>
    	<type>jar</type>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.apache.felix</groupId>
    	<artifactId>org.apache.felix.http.api</artifactId>
    	<version>2.2.0</version>
    	<type>jar</type>
    	<scope>compile</scope>
    </dependency>
    
    </dependencies>
    
    <distributionManagement>
	<snapshotRepository>
		<id>sonatype-nexus-snapshots</id>
		<name>Sonatype Nexus snapshot repository</name>
		<url>https://oss.sonatype.org/content/repositories/snapshots</url>
	</snapshotRepository>
	<repository>
		<id>sonatype-nexus-staging</id>
		<name>Sonatype Nexus release repository</name>
		<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
	</repository>
 </distributionManagement>

<profiles>
	<profile>
		<id>release-sign-artifacts</id>
		<activation>
			<property>
				<name>performRelease</name>
				<value>true</value>
			</property>
		</activation>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.4</version>
					<configuration>
						<passphrase>${gpg.passphrase}</passphrase>
					</configuration>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
								<goal>sign</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
</profiles>

</project>