Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>pl.knpj</groupId>
- <artifactId>quizowanie</artifactId>
- <packaging>war</packaging>
- <version>0.0.1-SNAPSHOT</version>
- <name>Quizowanie project</name>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>9.4.1211.jre7</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>6.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <properties>
- <db.name>quizowanie</db.name>
- <db.dropDbSql>DROP DATABASE IF EXISTS ${db.name}</db.dropDbSql>
- <db.createSchemaFilePath>src/main/resources/db_scripts/createDB.sql</db.createSchemaFilePath>
- <db.createDb>CREATE DATABASE ${db.name}</db.createDb>
- </properties>
- <profiles>
- <profile>
- <id>mysql</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sql-maven-plugin</artifactId>
- <version>1.5</version>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>6.0.3</version>
- </dependency>
- </dependencies>
- <configuration>
- <driver>com.mysql.cj.jdbc.Driver</driver>
- <!--<![CDATA is used to escape all xml special characters - it says that this is character data-->
- <!--unfortunately there is issue with timezone an mysql so we need to set it manually-->
- <url>
- <![CDATA[jdbc:mysql://127.0.0.1:3306?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC]]>
- </url>
- <username>${db.username}</username>
- <password>${db.password}</password>
- <settingsKey>sensibleKey</settingsKey>
- </configuration>
- <!--what will be executed-->
- <executions>
- <execution>
- <id>drop-table</id>
- <phase>install</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <autocommit>true</autocommit>
- <sqlCommand>${db.dropDbSql}</sqlCommand>
- </configuration>
- </execution>
- <execution>
- <id>create-schema</id>
- <phase>install</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <autocommit>true</autocommit>
- <srcFiles>
- <srcFile>${db.createSchemaFilePath}</srcFile>
- </srcFiles>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>postgresql</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sql-maven-plugin</artifactId>
- <version>1.5</version>
- <dependencies>
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>9.4.1211.jre7</version>
- </dependency>
- </dependencies>
- <configuration>
- <driver>org.postgresql.Driver</driver>
- <url>jdbc:postgresql://localhost:5432/postgres</url>
- <username>${db.username}</username>
- <password>${db.password}</password>
- <settingsKey>sensibleKey</settingsKey>
- </configuration>
- <!--what will be executed-->
- <executions>
- <execution>
- <id>drop-table</id>
- <phase>install</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <url>jdbc:postgresql://localhost:5432/postgres</url>
- <autocommit>true</autocommit>
- <sqlCommand>${db.dropDbSql}</sqlCommand>
- </configuration>
- </execution>
- <!--wywalona ze skryptu linijka o tworzeniu bazy, do testow czy w ogole dziala-->
- <execution>
- <id>create-db</id>
- <phase>install</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <autocommit>true</autocommit>
- <sqlCommand>${db.createDb}</sqlCommand>
- </configuration>
- </execution>
- <execution>
- <id>create-schema</id>
- <phase>install</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <!--z tym nie dziala, a bez tego tworzy tabele w bazie postgres-->
- <!--<url>jdbc:postgressql://localhost:5432/${db.name}</url>-->
- <autocommit>true</autocommit>
- <srcFiles>
- <srcFile>${db.createSchemaFilePath}</srcFile>
- </srcFiles>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <build>
- <finalName>quizowanie</finalName>
- </build>
- </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement