Skip to content

Database does not bind to pgServerPort on Windows #11

@Tibor17

Description

@Tibor17

We started the plugin, see POM, via mvn verify.
We also added a proxy to settings.xml.
We are not able to connect to the port 5432 via telnet localhost 5432 on Windows.
On Linux Ubuntu 16 we are able to connect via telnet and PgAdmin too.
We think that the command line is not constructed so well on Windows.

After we found the ZIP in user home, we extracted and started the database on command line with our commands, the database was bound to the port 5432 and telnet connected to it on Windows.
We used these native commands:

set PGDATA=e:\tmp\zmaz\xx\x\target\data\
pg_ctl initdb
pg_ctl start -D e:\tmp\zmaz\xx\x\target\data\ -l logfile

now telnet:
telnet localhost 5432

Stop the database after successful connection
pg_ctl stop -D e:\tmp\zmaz\xx\x\target\data\ -l logfile

Here is our POM:

<plugin>
	<groupId>com.github.slavaz</groupId>
	<artifactId>embedded-postgresql-maven-plugin</artifactId>
	<version>1.2.2</version>
	<configuration>
		<pgServerVersion>9.6</pgServerVersion>
		<dbName>audit</dbName>
	</configuration>
	<executions>
		<execution>
			<id>start-pgsql</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
			</goals>
		</execution>
		<execution>
			<id>stop-pgsql</id>
			<phase>post-integration-test</phase>
			<goals>
				<goal>stop</goal>
			</goals>
		</execution>
	</executions>
</plugin>

Here are Maven Debug logs of plugin configuration:

[DEBUG] Goal:          com.github.slavaz:embedded-postgresql-maven-plugin:1.1.0:start (start-pgsql)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <dbName>audit</dbName>
  <password default-value="postgres"/>
  <pgCharset>${pgCharset}</pgCharset>
  <pgDatabaseDir>${pgDatabasedir}</pgDatabaseDir>
  <pgLocale>${pgLocale}</pgLocale>
  <pgServerPort default-value="5432">${pgPort}</pgServerPort>
  <pgServerVersion default-value="latest">9.6</pgServerVersion>
  <pluginDependencies default-value="${plugin.artifacts}"/>
  <projectBuildDir default-value="${project.build.directory}"/>
  <settings default-value="${settings}"/>
  <skipGoal default-value="false"/>
  <userName default-value="postgres">${username}</userName>
</configuration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions