Skip to content

Latest commit

 

History

History
145 lines (137 loc) · 3.5 KB

README.md

File metadata and controls

145 lines (137 loc) · 3.5 KB

postgresql-dist

A maven project for distributing PostgresQL binaries as Maven artifacts. 9.2.4 was already published to Maven Central. Older versions could be published as well.

Simple usage example (windows):

<plugin>
	<artifactId>maven-dependency-plugin</artifactId>
	<version>2.6</version>
	<executions>
		<execution>
			<id>unpack-postgresql</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>unpack</goal>
			</goals>
			<configuration>
				<artifactItems>
					<artifactItem>
						<groupId>com.github.adrianboimvaser</groupId>
						<artifactId>postgresql-dist</artifactId>
						<classifier>windows</classifier>
						<version>9.2.4</version>
						<type>zip</type>
						<overWrite>true</overWrite>
						<outputDirectory>${project.build.directory}</outputDirectory>
					</artifactItem>
				</artifactItems>
			</configuration>
		</execution>
	</executions>
</plugin>

Complex usage example (let the build choose the platform):

<properties>
	<postgresql-dist.version>9.3.4</postgresql-dist.version>
</properties>

<profiles>
	<profile>
		<id>linux-x86</id>
		<activation>
			<os>
				<family>unix</family>
				<name>Linux</name>
				<arch>x86</arch>
			</os>
		</activation>
		<properties>
			<postgresql-dist.classifier>linux</postgresql-dist.classifier>
			<postgresql-dist.type>tar.gz</postgresql-dist.type>
		</properties>
	</profile>
	<profile>
		<id>linux-x64</id>
		<activation>
			<os>
				<family>unix</family>
				<name>Linux</name>
				<arch>amd64</arch>
			</os>
		</activation>
		<properties>
			<postgresql-dist.classifier>linux-x64</postgresql-dist.classifier>
			<postgresql-dist.type>tar.gz</postgresql-dist.type>
		</properties>
	</profile>
	<profile>
		<id>windows-x86</id>
		<activation>
			<os>
				<family>windows</family>
				<arch>x86</arch>
			</os>
		</activation>
		<properties>
			<postgresql-dist.classifier>windows</postgresql-dist.classifier>
			<postgresql-dist.type>zip</postgresql-dist.type>
		</properties>
	</profile>
	<profile>
		<id>windows-x64</id>
		<activation>
			<os>
				<family>windows</family>
				<arch>amd64</arch>
			</os>
		</activation>
		<properties>
			<postgresql-dist.classifier>windows-x64</postgresql-dist.classifier>
			<postgresql-dist.type>zip</postgresql-dist.type>
		</properties>
	</profile>
	<profile>
		<id>osx</id>
		<activation>
			<os>
				<family>mac</family>
			</os>
		</activation>
		<properties>
			<postgresql-dist.classifier>osx</postgresql-dist.classifier>
			<postgresql-dist.type>zip</postgresql-dist.type>
		</properties>
	</profile>
</profiles>

<build>
	<plugins>
		...
		<plugin>
			<artifactId>maven-dependency-plugin</artifactId>
			<version>2.8</version>
			<executions>
				<execution>
					<id>unpack-postgresql</id>
					<phase>pre-integration-test</phase>
					<goals>
						<goal>unpack</goal>
					</goals>
					<configuration>
						<skip>${skipITs}</skip>
						<artifactItems>
							<artifactItem>
								<groupId>com.github.adrianboimvaser</groupId>
								<artifactId>postgresql-dist</artifactId>
								<classifier>${postgresql-dist.classifier}</classifier>
								<version>${postgresql-dist.version}</version>
								<type>${postgresql-dist.type}</type>
								<overWrite>true</overWrite>
								<outputDirectory>${project.build.directory}</outputDirectory>
							</artifactItem>
						</artifactItems>
					</configuration>
				</execution>
			</executions>
		</plugin>
		...
	</plugins>
</build>