<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>

	<!-- The Basics -->
	<groupId>org.oddgen</groupId>
	<artifactId>org.oddgen.sqldev</artifactId>
	<version>0.3.0</version>
	<packaging>bundle</packaging>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jdk.version>1.7</jdk.version>
		<jdk.version.test>1.8</jdk.version.test>
		<xtend.version>2.12.0</xtend.version>
		<sqldev.basedir>/Applications/SQLDeveloper17.2.0.app/Contents/Resources/sqldeveloper</sqldev.basedir>
		<final.name>oddgen_for_SQLDev_${project.version}</final.name>
	</properties>
	<dependencies>
		<!-- SQL Developer specific dependencies part 1 (not available in public 
			maven repositories) -->
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>idert</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/lib/idert.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>javatools-nodeps</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/modules/oracle.javatools/javatools-nodeps.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>javatools</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/lib/javatools.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.ide.ceditor</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/extensions/oracle.ide.ceditor.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.ide</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/extensions/oracle.ide.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>uic</artifactId>
			<version>12.2.2</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/lib/uic.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.sqldeveloper.utils</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/sqldeveloper/extensions/oracle.sqldeveloper.utils.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.ide.navigator</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/extensions/oracle.ide.navigator.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>javax-ide</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/lib/javax-ide.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.dbtools-common</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/sqldeveloper/lib/oracle.dbtools-common.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.sqldeveloper</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/sqldeveloper/extensions/oracle.sqldeveloper.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle.sqldeveloper.worksheet</artifactId>
			<version>12.2.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/sqldeveloper/extensions/oracle.sqldeveloper.worksheet.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>ojdbc8</artifactId>
			<version>12.2.0.1.0</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/jdbc/lib/ojdbc8.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>dbapi</artifactId>
			<version>12.2.1</version>
			<scope>system</scope>
			<systemPath>${sqldev.basedir}/ide/lib/dbapi.jar</systemPath>
		</dependency>
		<!-- SQL Developer specific dependencies part 2 (available in public maven 
			repositories) -->
		<dependency>
			<!-- SQL Developer is using this older version -->
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>5.0.0</version>
			<scope>provided</scope>
		</dependency>
		<!-- logging dependencies -->
		<dependency>
			<!-- configure annotated logging via class com.jcabi, see https://github.com/jcabi/jcabi-aspects/issues/156 -->
			<groupId>com.jcabi</groupId>
			<artifactId>jcabi-aspects</artifactId>
			<version>0.22.6</version>
		</dependency>
		<dependency>
			<!-- override dependency from jcabi-aspects -->
			<groupId>com.jcabi</groupId>
			<artifactId>jcabi-log</artifactId>
			<version>0.17.2</version>
		</dependency>
		<dependency>
			<!-- override dependency from jcabi-aspects -->
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.8.9</version>
		</dependency>
		<dependency>
			<!-- required for jcabi-aspects when weaving Java 1.8 classes -->
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjtools</artifactId>
			<version>1.8.9</version>
		</dependency>
		<dependency>
			<!-- binds slf4j to java.util.logging (used by SQL Developer), see implementations 
				on http://www.slf4j.org/ -->
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
			<version>1.7.25</version>
		</dependency>
		<!-- other dependencies -->
		<dependency>
			<!-- Xtend comes with some runtime dependencies... -->
			<!-- cannot resolve plugin-dependencies for 2.10.0, fallback to ${xtend.version} -->
			<groupId>org.eclipse.xtend</groupId>
			<artifactId>org.eclipse.xtend.lib</artifactId>
			<version>${xtend.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>4.3.10.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.reflections</groupId>
			<artifactId>reflections</artifactId>
			<version>0.9.10</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- Build Settings -->
	<build>
		<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
		<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.*</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.eclipse.xtend</groupId>
				<artifactId>xtend-maven-plugin</artifactId>
				<version>${xtend.version}</version>
				<executions>
					<execution>
						<id>main</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<javaSourceVersion>${jdk.version}</javaSourceVersion>
							<outputDirectory>${project.basedir}/src/main/xtend-gen</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<id>test</id>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<javaSourceVersion>${jdk.version.test}</javaSourceVersion>
							<testOutputDirectory>${project.basedir}/src/test/xtend-gen</testOutputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<version>3.7.0</version>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<!-- used by Maven build -->
					<testSource>${jdk.version.test}</testSource>
					<testTarget>${jdk.version.test}</testTarget>
					<includes>
						<include>**/*.java</include>
					</includes>
				</configuration>
				<executions>
					<!-- used by Eclipse when updating project -->
					<execution>
						<id>test-compile</id>
						<phase>process-test-sources</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<source>${jdk.version.test}</source>
							<target>${jdk.version.test}</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.jcabi</groupId>
				<artifactId>jcabi-maven-plugin</artifactId>
				<version>0.14.1</version>
				<executions>
					<execution>
						<goals>
							<goal>ajc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.20</version>
				<configuration>
					<!-- -noverify is required in some environments to avoid java.lang.VerifyError -->
					<argLine>-noverify
						-Djava.util.logging.config.file=${project.basedir}/src/test/resources/logging.conf</argLine>
					<includes>
						<include>**/*.java</include>
					</includes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<!-- version inherited from plugin section -->
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<format>{0,date,yyyyMMdd.HHmmss}</format>
					<items>
						<item>timestamp</item>
					</items>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<configuration>
							<target>
								<copy failonerror="true" file="sqldeveloper.xml" tofile="target/sqldeveloper.xml" />
								<copy failonerror="true" file="bundle.xml" tofile="target/bundle.xml" />
								<copy failonerror="true" file="extension.xml"
									tofile="target/classes/META-INF/extension.xml" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
				<version>1.0.0</version>
				<executions>
					<execution>
						<phase>initialize</phase>
						<goals>
							<goal>read-project-properties</goal>
						</goals>
						<configuration>
							<urls>
								<url>
									file:///${project.basedir}/src/main/resources/org/oddgen/sqldev/resources/OddgenResources.properties
								</url>
							</urls>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>parse-version</id>
						<goals>
							<goal>parse-version</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.3</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<includes>
						<include>${project.basedir}/target/sqldeveloper.xml</include>
						<include>${project.basedir}/target/bundle.xml</include>
						<include>${project.basedir}/target/classes/META-INF/extension.xml</include>
					</includes>
					<replacements>
						<replacement>
							<token>#EXTENSION_VERSION#</token>
							<value>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${buildNumber}</value>
						</replacement>
						<replacement>
							<token>#EXTENSION_SHORT_VERSION#</token>
							<value>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</value>
						</replacement>
						<replacement>
							<token>#EXTENSION_DEPLOYABLE#</token>
							<value>${final.name}.zip</value>
						</replacement>
						<replacement>
							<token>#EXTENSION_NAME#</token>
							<value>${EXTENSION_NAME}</value>
						</replacement>
						<replacement>
							<token>#EXTENSION_OWNER#</token>
							<value>${EXTENSION_OWNER}</value>
						</replacement>
					</replacements>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<!-- version 3.0.1 throws null pointer exception -->
				<version>3.3.0</version>
				<extensions>true</extensions>
				<configuration>
					<finalName>${project.name}</finalName>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
					</archive>
					<instructions>
						<Bundle-SymbolicName>${project.name}</Bundle-SymbolicName>
						<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</Bundle-Version>
						<Bundle-Build>${buildNumber}</Bundle-Build>
						<Include-Resource>
							{maven-resources},
							{maven-dependencies},
							META-INF/extension.xml=target/classes/META-INF/extension.xml
						</Include-Resource>
						<Export-Package>
							org.oddgen.sqldev,
							org.oddgen.sqldev.dal,
							org.oddgen.sqldev.generators, 
							org.oddgen.sqldev.generators.model,
							org.oddgen.sqldev.model,
							org.oddgen.sqldev.resources
						</Export-Package>
						<_exportcontents>
							com.google.common.base,
							com.google.common.collect, 
							com.google.common.primitives, 
							com.jcabi.aspects,
							javax.annotation,
							javax.annotation.meta,
							org.aspectj.lang, 
							org.aspectj.lang.reflect,
							org.aspectj.runtime,
							org.aspectj.runtime.internal, 
							org.eclipse.xtext.xbase.lib
						</_exportcontents>
						<!-- TODO: remove unnecessary bundles, missing bundles might lead to 
							strange runtime behavior, therefore the list is extensive -->
						<Require-Bundle>
							oracle.external.nlsrtl,
							oracle.external.xmlparser,
							oracle.javatools,
							oracle.javatools-nodeps,
							oracle.ide,
							oracle.ide.ceditor,
							oracle.ide.status,
							oracle.ide.audit,
							oracle.peek,
							oracle.ide.navigator,
							oracle.ide.runner,
							oracle.ide.webbrowser,
							oracle.ide.externaltools,
							oracle.ide.inspector,
							oracle.ide.palette2,
							oracle.uic,
							oracle.idert,
							oracle.javaxide,
							oracle.icons,
							oracle.jdeveloper.java.core,
							oracle.jdeveloper.common,
							oracle.db-ca,
							oracle.jdev-cm,
							oracle.ide.db,
							oracle.jdeveloper.db.connection,
							oracle.orahelp-helpshare,
							oracle.orahelp-ohj,
							oracle.external.oracle-ice,
							oracle.jewt-core,
							oracle.external.balishare,
							oracle.external.jdbc,
							oracle.sqldeveloper,
							oracle.sqldeveloper.utils,
							oracle.sqldeveloper.worksheet,
							oracle.external.itext
						</Require-Bundle>
						<Import-Package>!*</Import-Package>
						<Embed-Directory>lib</Embed-Directory>
						<Embed-Transitive>true</Embed-Transitive>
						<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<finalName>${final.name}</finalName>
					<appendAssemblyId>false</appendAssemblyId>
					<descriptors>
						<descriptor>sqldev_assembly.xml</descriptor>
					</descriptors>
					<recompressZippedFiles>true</recompressZippedFiles>
				</configuration>
				<executions>
					<execution>
						<id>deploy-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.6</version>
				<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-source-plugin</artifactId>
				<version>3.0.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.10.4</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- inspect https://oss.sonatype.org/#stagingRepositories -->
			<!-- close, release and drop staging repositories via GUI -->
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.8</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<skipLocalStaging>true</skipLocalStaging>
					<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</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.apache.maven.plugins</groupId>
										<artifactId>maven-dependency-plugin</artifactId>
										<versionRange>[3.0.1,)</versionRange>
										<goals>
											<goal>copy-dependencies</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											build-helper-maven-plugin
										</artifactId>
										<versionRange>
											[3.0.0,)
										</versionRange>
										<goals>
											<goal>parse-version</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.jcabi</groupId>
										<artifactId>
											jcabi-maven-plugin
										</artifactId>
										<versionRange>
											[0.14.1,)
										</versionRange>
										<goals>
											<goal>ajc</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>buildnumber-maven-plugin</artifactId>
					<version>1.4</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<!-- More Project Information -->
	<name>org.oddgen.sqldev</name>
	<description>oddgen for SQL Developer provides tooling for dictionary driven code generators.</description>
	<url>https://github.com/oddgen/oddgen</url>
	<inceptionYear>2015</inceptionYear>
	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<organization>
		<name>oddgen</name>
		<url>https://www.oddgen.org/</url>
	</organization>
	<developers>
		<developer>
			<email>philipp.salvisberg@trivadis.com</email>
			<name>Philipp Salvisberg</name>
			<url>https://github.com/PhilippSalvisberg/</url>
			<id>PhilippSalvisberg</id>
			<roles>
				<role>lead</role>
				<role>developer</role>
			</roles>
		</developer>
	</developers>

	<!-- Environment Settings -->
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/oddgen/oddgen/issues</url>
	</issueManagement>
	<scm>
		<connection>scm:git:git://github.com/oddgen/oddgen.git</connection>
		<developerConnection>scm:git:git@github.com:oddgen/oddgen.git</developerConnection>
		<tag>master</tag>
		<url>https://github.com/oddgen/oddgen/</url>
	</scm>

	<!-- Distribution Management for Maven Central Repository -->
	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>
</project>
