<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.onosproject</groupId>
	<artifactId>onos-yang-tool</artifactId>
	<version>1.3</version>

	<name>${project.artifactId}</name>
	<description>ONOS Yang Tools for NETCONF</description>

	<url>http://onosproject.org/</url>

	<scm>
		<connection>scm:git:https://gerrit.onosproject.org/onos-yang-tool</connection>
		<developerConnection>scm:git:https://gerrit.onosproject.org/onos-yang-tool</developerConnection>
		<url>http://gerrit.onosproject.org/</url>
	</scm>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<organization>ON.Lab</organization>
			<organizationUrl>http://www.onlab.us</organizationUrl>
		</developer>
	</developers>

	<properties>
		<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<repositories>
		<!-- OpenDayLight Repo Mirror -->
		<repository>
			<id>opendaylight-mirror</id>
			<name>opendaylight-mirror</name>
			<url>http://nexus.opendaylight.org/content/groups/public/</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</releases>
		</repository>

		<!-- OpenDayLight Snapshot artifact -->
		<repository>
			<id>opendaylight-snapshot</id>
			<name>opendaylight-snapshot</name>
			<url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</repository>
	</repositories>

        <distributionManagement>
            <snapshotRepository>
                <id>ossrh</id>
                <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            </snapshotRepository>
        </distributionManagement>

	<pluginRepositories>
		<!-- OpenDayLight Repo Mirror -->
		<pluginRepository>
			<id>opendaylight-mirror</id>
			<name>opendaylight-mirror</name>
			<url>${nexusproxy}/groups/public/</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</releases>
		</pluginRepository>

		<!-- OpenDayLight Snapshot artifact -->
		<pluginRepository>
			<id>opendaylight-snapshot</id>
			<name>opendaylight-snapshot</name>
			<url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</pluginRepository>
	</pluginRepositories>

	<dependencies>
		<dependency>
			<groupId>org.opendaylight.yangtools</groupId>
			<artifactId>yang-binding</artifactId>
			<version>0.6.2-Helium</version>
		</dependency>
		<dependency>
			<groupId>org.opendaylight.yangtools</groupId>
			<artifactId>yang-common</artifactId>
			<version>0.6.2-Helium</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.opendaylight.yangtools</groupId>
				<artifactId>yang-maven-plugin</artifactId>
				<version>0.6.2-Helium</version>
				<executions>
					<execution>
						<goals>
							<goal>generate-sources</goal>
						</goals>
						<configuration>
							<!-- directory containing yang files to parse and generate code -->
							<yangFilesRootDir>src/main/yang/acl</yangFilesRootDir>
							<codeGenerators>
								<generator>
									<codeGeneratorClass>
										org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
									</codeGeneratorClass>
									<!-- directory into which generated files will be placed -->
									<outputBaseDir>
										src/main/java
									</outputBaseDir>
								</generator>
							</codeGenerators>
							<!-- if true, plugin will search for yang files also in dependent 
								projects -->
							<inspectDependencies>true</inspectDependencies>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.opendaylight.yangtools</groupId>
						<artifactId>maven-sal-api-gen-plugin</artifactId>
						<version>0.6.2-Helium</version>
						<type>jar</type>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.opendaylight.controller
										</groupId>
										<artifactId>
											yang-maven-plugin
										</artifactId>
										<versionRange>
											[0.5,)
										</versionRange>
										<goals>
											<goal>
												generate-sources
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
    <profiles>
      <profile>
        <id>release</id>
        <build>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
                  <version>2.2.1</version>
                  <executions>
                      <execution>
                          <id>attach-sources</id>
                          <goals>
                              <goal>jar-no-fork</goal>
                          </goals>
                      </execution>
                  </executions>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <version>2.9.1</version>
                  <executions>
                      <execution>
                          <id>attach-javadocs</id>
                          <goals>
                              <goal>jar</goal>
                          </goals>
                          <configuration>
                              <!-- 
                                   Adding parameter to disable DocLint which fails the 
                                   build due to Javadoc errors in auto-generated code.
                              -->
                              <additionalparam>-Xdoclint:none</additionalparam>
                          </configuration>
                      </execution>
                  </executions>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>1.5</version>
                  <executions>
                      <execution>
                          <id>sign-artifacts</id>
                          <phase>verify</phase>
                          <goals>
                              <goal>sign</goal>
                          </goals>
                      </execution>
                  </executions>
              </plugin>
              <plugin>
                  <groupId>org.sonatype.plugins</groupId>
                  <artifactId>nexus-staging-maven-plugin</artifactId>
                  <version>1.6.5</version>
                  <extensions>true</extensions>
                  <configuration>
                      <serverId>ossrh</serverId>
                      <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                      <autoReleaseAfterClose>false</autoReleaseAfterClose>
                  </configuration>
              </plugin>
          </plugins>
        </build>
      </profile>
    </profiles>
</project>
