Advertisement
Guest User

pom.xml

a guest
Nov 24th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 8.33 KB | None | 0 0
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2.         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3.     <modelVersion>4.0.0</modelVersion>
  4.     <groupId>pl.knpj</groupId>
  5.     <artifactId>quizowanie</artifactId>
  6.     <packaging>war</packaging>
  7.     <version>0.0.1-SNAPSHOT</version>
  8.     <name>Quizowanie project</name>
  9.  
  10.     <dependencies>
  11.         <dependency>
  12.             <groupId>javax.servlet</groupId>
  13.             <artifactId>javax.servlet-api</artifactId>
  14.             <version>3.1.0</version>
  15.             <scope>compile</scope>
  16.         </dependency>
  17.         <dependency>
  18.             <groupId>org.postgresql</groupId>
  19.             <artifactId>postgresql</artifactId>
  20.             <version>9.4.1211.jre7</version>
  21.         </dependency>
  22.         <dependency>
  23.             <groupId>mysql</groupId>
  24.             <artifactId>mysql-connector-java</artifactId>
  25.             <version>6.0.3</version>
  26.         </dependency>
  27.         <dependency>
  28.             <groupId>junit</groupId>
  29.             <artifactId>junit</artifactId>
  30.             <version>4.12</version>
  31.             <scope>test</scope>
  32.         </dependency>
  33.         <dependency>
  34.             <groupId>org.mockito</groupId>
  35.             <artifactId>mockito-all</artifactId>
  36.             <version>1.10.19</version>
  37.             <scope>test</scope>
  38.         </dependency>
  39.     </dependencies>
  40.  
  41.     <properties>
  42.         <db.name>quizowanie</db.name>
  43.         <db.dropDbSql>DROP DATABASE IF EXISTS ${db.name}</db.dropDbSql>
  44.         <db.createSchemaFilePath>src/main/resources/db_scripts/createDB.sql</db.createSchemaFilePath>
  45.         <db.createDb>CREATE DATABASE ${db.name}</db.createDb>
  46.     </properties>
  47.  
  48.     <profiles>
  49.         <profile>
  50.             <id>mysql</id>
  51.  
  52.             <build>
  53.                 <plugins>
  54.                     <plugin>
  55.                         <groupId>org.codehaus.mojo</groupId>
  56.                         <artifactId>sql-maven-plugin</artifactId>
  57.                         <version>1.5</version>
  58.  
  59.                         <dependencies>
  60.                             <dependency>
  61.                                 <groupId>mysql</groupId>
  62.                                 <artifactId>mysql-connector-java</artifactId>
  63.                                 <version>6.0.3</version>
  64.                             </dependency>
  65.                         </dependencies>
  66.  
  67.                         <configuration>
  68.                             <driver>com.mysql.cj.jdbc.Driver</driver>
  69.  
  70.                             <!--<![CDATA is used to escape all xml special characters - it says that this is character data-->
  71.                             <!--unfortunately there is issue with timezone an mysql so we need to set it manually-->
  72.                             <url>
  73.                                 <![CDATA[jdbc:mysql://127.0.0.1:3306?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC]]>
  74.                             </url>
  75.  
  76.                             <username>${db.username}</username>
  77.                             <password>${db.password}</password>
  78.                             <settingsKey>sensibleKey</settingsKey>
  79.                         </configuration>
  80.  
  81.                         <!--what will be executed-->
  82.                         <executions>
  83.                             <execution>
  84.                                 <id>drop-table</id>
  85.                                 <phase>install</phase>
  86.                                 <goals>
  87.                                     <goal>execute</goal>
  88.                                 </goals>
  89.                                 <configuration>
  90.                                     <autocommit>true</autocommit>
  91.                                     <sqlCommand>${db.dropDbSql}</sqlCommand>
  92.                                 </configuration>
  93.                             </execution>
  94.  
  95.                             <execution>
  96.                                 <id>create-schema</id>
  97.                                 <phase>install</phase>
  98.                                 <goals>
  99.                                     <goal>execute</goal>
  100.                                 </goals>
  101.                                 <configuration>
  102.                                     <autocommit>true</autocommit>
  103.                                     <srcFiles>
  104.                                         <srcFile>${db.createSchemaFilePath}</srcFile>
  105.                                     </srcFiles>
  106.                                 </configuration>
  107.                             </execution>
  108.                         </executions>
  109.                     </plugin>
  110.                 </plugins>
  111.             </build>
  112.         </profile>
  113.  
  114.             <profile>
  115.             <id>postgresql</id>
  116.  
  117.             <build>
  118.                 <plugins>
  119.                     <plugin>
  120.                         <groupId>org.codehaus.mojo</groupId>
  121.                         <artifactId>sql-maven-plugin</artifactId>
  122.                         <version>1.5</version>
  123.  
  124.                         <dependencies>
  125.                             <dependency>
  126.                                 <groupId>org.postgresql</groupId>
  127.                                 <artifactId>postgresql</artifactId>
  128.                                 <version>9.4.1211.jre7</version>
  129.                             </dependency>
  130.                         </dependencies>
  131.  
  132.                         <configuration>
  133.                             <driver>org.postgresql.Driver</driver>
  134.                             <url>jdbc:postgresql://localhost:5432/postgres</url>
  135.                             <username>${db.username}</username>
  136.                             <password>${db.password}</password>
  137.                             <settingsKey>sensibleKey</settingsKey>
  138.                         </configuration>
  139.  
  140.                         <!--what will be executed-->
  141.                         <executions>
  142.                             <execution>
  143.                                 <id>drop-table</id>
  144.                                 <phase>install</phase>
  145.                                 <goals>
  146.                                     <goal>execute</goal>
  147.                                 </goals>
  148.                                 <configuration>
  149.                                     <!--<url>jdbc:postgresql://localhost:5432/postgres</url>-->
  150.                                     <autocommit>true</autocommit>
  151.                                     <sqlCommand>${db.dropDbSql}</sqlCommand>
  152.                                 </configuration>
  153.                             </execution>
  154.  
  155.                             <!--wywalona ze skryptu linijka o tworzeniu bazy, do testow czy w ogole dziala-->
  156.                             <execution>
  157.                                 <id>create-db</id>
  158.                                 <phase>install</phase>
  159.                                 <goals>
  160.                                     <goal>execute</goal>
  161.                                 </goals>
  162.                                 <configuration>
  163.                                     <autocommit>true</autocommit>
  164.                                     <sqlCommand>${db.createDb}</sqlCommand>
  165.                                 </configuration>
  166.                             </execution>
  167.  
  168.                             <execution>
  169.                                 <id>create-schema</id>
  170.                                 <phase>install</phase>
  171.                                 <goals>
  172.                                     <goal>execute</goal>
  173.                                 </goals>
  174.                                 <configuration>
  175.                                     <!--z tym nie dziala, a bez tego tworzy tabele w bazie postgres-->
  176.                                     <!--<url>jdbc:postgressql://localhost:5432/${db.name}</url>-->
  177.                                     <autocommit>true</autocommit>
  178.                                     <srcFiles>
  179.                                         <srcFile>${db.createSchemaFilePath}</srcFile>
  180.                                     </srcFiles>
  181.                                 </configuration>
  182.                             </execution>
  183.                         </executions>
  184.                     </plugin>
  185.                 </plugins>
  186.             </build>
  187.         </profile>
  188.  
  189.     </profiles>
  190.  
  191.     <build>
  192.         <finalName>quizowanie</finalName>
  193.     </build>
  194. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement