<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>me.moocar</groupId>
  <artifactId>socket-encoder-appender</artifactId>
  <packaging>jar</packaging>
  <version>0.1beta1</version>
  <name>socket-encoder-appender</name>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <description>A Logback Appender that encodes logs using an Encoder, and sends the result to a remote host over TCP</description>

  <url>https://github.com/Moocar/socket-encoder-appender</url>

  <inceptionYear>2015</inceptionYear>

  <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>
    <connection>scm:git:git@github.com:Moocar/socket-encoder-appender.git</connection>
    <developerConnection>scm:git:git@github.com:Moocar/socket-encoder-appender.git</developerConnection>
    <url>git@github.com:Moocar/socket-encoder-appender.git</url>
  </scm>

  <developers>
    <developer>
      <name>Anthony Marcar</name>
      <email>anthony@moocar.me</email>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.12</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.1.3</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </plugin>
      <plugin>
        <!-- be sure to add github.global.userName and github.global.password to your profile properties in settings.xml -->
        <!-- run with mvn clean install assembly:single ghDownloads:upload -->
        <groupId>com.github.github</groupId>
        <artifactId>downloads-maven-plugin</artifactId>
        <version>0.4</version>
        <configuration>
          <description>${project.version} release of ${project.name}</description>
          <override>false</override>
          <includeAttached>true</includeAttached>
        </configuration>
      </plugin>


      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <!-- packages to export -->
            <Export-Package>me.moocar.logback.net</Export-Package>
            <!-- attach to Logback bundle as fragment -->
            <Fragment-Host>ch.qos.logback.classic</Fragment-Host>
          </instructions>
        </configuration>
      </plugin>

      <!-- Build helper maven plugin sets the parsedVersion.osgiVersion property -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>set-osgi-version</id>
            <phase>verify</phase>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- source maven plugin creates the source bundle and adds manifest -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifestEntries>
              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
              <Bundle-Name>${name}</Bundle-Name>
              <Bundle-SymbolicName>${groupId}.${artifactId}.source</Bundle-SymbolicName>
              <Bundle-Vendor>${organization.name}</Bundle-Vendor>
              <Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>
              <Eclipse-SourceBundle>${groupId}.${artifactId};version="${parsedVersion.osgiVersion}";roots:="."</Eclipse-SourceBundle>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

    </plugins>

  </build>

  <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>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
