Skip to content

adrianboimvaser/postgresql-dist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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

<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>
	<profile>
		<id>linux</id>
		<activation>
			<os>
				<family>unix</family>
				<name>Linux</name>
			</os>
		</activation>
		<build>
			<plugins>
				<plugin>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.6</version>
					<executions>
						<execution>
							<id>copy-postgresql-linux</id>
							<phase>pre-integration-test</phase>
							<goals>
								<goal>copy</goal>
							</goals>
							<configuration>
								<skip>${skipITs}</skip>
								<artifactItems>
									<artifactItem>
										<groupId>com.github.adrianboimvaser</groupId>
										<artifactId>postgresql-dist</artifactId>
										<classifier>${postgresql-dist.classifier}</classifier>
										<version>9.2.4</version>
										<type>${postgresql-dist.type}</type>
										<overWrite>true</overWrite>
										<outputDirectory>${project.build.directory}</outputDirectory>
									</artifactItem>
								</artifactItems>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.2.1</version>
					<executions>
						<execution>
							<id>unzip-postgresql-linux</id>
							<phase>pre-integration-test</phase>
							<goals>
								<goal>exec</goal>
							</goals>
							<configuration>
								<skip>${skipITs}</skip>
								<executable>tar</executable>
								<arguments>
									<argument>-zxvf</argument>
									<argument>${project.build.directory}/postgresql-dist-9.2.4-1-${postgresql-dist.classifier}.${postgresql-dist.type}</argument>
									<argument>-C</argument>
									<argument>${project.build.directory}</argument>
								</arguments>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
	<profile>
		<id>windows</id>
		<activation>
			<os>
				<family>windows</family>
			</os>
		</activation>
		<build>
			<plugins>
				<plugin>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.6</version>
					<executions>
						<execution>
							<id>unpack-postgresql-windows</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>9.2.4</version>
										<type>${postgresql-dist.type}</type>
										<overWrite>true</overWrite>
										<outputDirectory>${project.build.directory}</outputDirectory>
									</artifactItem>
								</artifactItems>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
</profiles>

About

PostgresQL binaries distributed as Maven artifacts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published