Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 9.37 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Context path="/ContactApp">
  3.     <Resource
  4.            driverClassName="com.mysql.jdbc.Driver"
  5.            maxActive="4"
  6.            maxIdle="2"
  7.            maxWait="5000"
  8.            name="jdbc/contact_app"
  9.            username="root"
  10.            password="root"
  11.            type="javax.sql.DataSource"
  12.            url="jdbc:mysql://localhost:3306/contact_app"
  13.            validationQuery="SELECT 1">
  14.     </Resource>
  15. </Context>
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. <?xml version="1.0" encoding="UTF-8"?>
  24. <project xmlns="http://maven.apache.org/POM/4.0.0"
  25.         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  26.         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  27.     <modelVersion>4.0.0</modelVersion>
  28.     <groupId>ContactApp</groupId>
  29.     <artifactId>ContactApp</artifactId>
  30.     <name>ContactApp</name>
  31.     <version>1.0-SNAPSHOT</version>
  32.     <packaging>war</packaging>
  33.  
  34.     <organization>
  35.         <name>ContactApp</name>
  36.     </organization>
  37.     <build>
  38.         <finalName>ContactApp</finalName>
  39.  
  40.         <plugins>
  41.  
  42.             <!--<plugin>-->
  43.                 <!--<groupId>org.apache.tomcat.maven</groupId>-->
  44.                 <!--<artifactId>tomcat7-maven-plugin</artifactId>-->
  45.                 <!--<version>2.2</version>-->
  46.                 <!--<configuration>-->
  47.                     <!--<url>http://172.18.0.2:8080/manager/text</url>-->
  48.                     <!--<path>/src</path>-->
  49.                     <!--<contextReloadable>true</contextReloadable>-->
  50.                 <!--</configuration>-->
  51.             <!--</plugin>-->
  52.  
  53.             <plugin>
  54.                 <groupId>org.apache.maven.plugins</groupId>
  55.                 <artifactId>maven-compiler-plugin</artifactId>
  56.                 <configuration>
  57.                     <source>1.8</source>
  58.                     <target>1.8</target>
  59.                 </configuration>
  60.             </plugin>
  61.             <plugin>
  62.                 <groupId>org.apache.maven.plugins</groupId>
  63.                 <artifactId>maven-war-plugin</artifactId>
  64.                 <version>3.0.0</version>
  65.                 <dependencies>
  66.                     <dependency>
  67.                         <groupId>mysql</groupId>
  68.                         <artifactId>mysql-connector-java</artifactId>
  69.                         <version>5.1.9</version>
  70.                     </dependency>
  71.                 </dependencies>
  72.                 <configuration>
  73.                     <failOnMissingWebXml>false</failOnMissingWebXml>
  74.                     <archive>
  75.                         <manifest>
  76.                             <addClasspath>true</addClasspath>
  77.                             <classpathPrefix>lib/</classpathPrefix>
  78.                         </manifest>
  79.                     </archive>
  80.                     <webResources>
  81.                         <resource>
  82.                             <!-- this is relative to the pom.xml directory -->
  83.                             <directory>${project.basedir}/src/main/resources
  84.                             </directory>
  85.                         </resource>
  86.                     </webResources>
  87.                 </configuration>
  88.             </plugin>
  89.             <plugin>
  90.                 <groupId>org.apache.tomcat.maven</groupId>
  91.                 <artifactId>tomcat7-maven-plugin</artifactId>
  92.                 <version>2.2</version>
  93.                 <executions>
  94.                     <execution>
  95.                         <id>tomcat-run</id>
  96.                         <goals>
  97.                             <goal>run-war</goal>
  98.                         </goals>
  99.                         <phase>install</phase>
  100.                         <configuration>
  101.                             <port>8080</port>
  102.                             <path>/ContactApp</path>
  103.                         </configuration>
  104.                     </execution>
  105.                 </executions>
  106.             </plugin>
  107.  
  108.  
  109.             <!--Plugin for MySql DB-->
  110.             <plugin>
  111.                 <groupId>org.codehaus.mojo</groupId>
  112.                 <artifactId>sql-maven-plugin</artifactId>
  113.                 <version>1.5</version>
  114.                 <dependencies>
  115.                     <dependency>
  116.                         <groupId>mysql</groupId>
  117.                         <artifactId>mysql-connector-java</artifactId>
  118.                         <version>5.1.9</version>
  119.                     </dependency>
  120.                 </dependencies>
  121.                 <configuration>
  122.                     <driver>com.mysql.jdbc.Driver</driver>
  123.                     <url>jdbc:mysql://localhost:3306/</url>
  124.                     <username>root</username>
  125.                     <password>root</password>
  126.                 </configuration>
  127.                 <executions>
  128.                     <execution>
  129.                         <id>drop-schema</id>
  130.                         <phase>process-test-resources</phase>
  131.                         <goals>
  132.                             <goal>execute</goal>
  133.                         </goals>
  134.                         <configuration>
  135.                             <autocommit>true</autocommit>
  136.                             <srcFiles>
  137.                                 <srcFile>src/main/resources/sql/dropdb.sql</srcFile>
  138.                             </srcFiles>
  139.                         </configuration>
  140.                     </execution>
  141.                     <execution>
  142.                         <id>create-schema</id>
  143.                         <phase>process-test-resources</phase>
  144.                         <goals>
  145.                             <goal>execute</goal>
  146.                         </goals>
  147.                         <configuration>
  148.                             <autocommit>true</autocommit>
  149.                             <srcFiles>
  150.                                 <srcFile>src/main/resources/sql/create.sql</srcFile>
  151.                             </srcFiles>
  152.                         </configuration>
  153.                     </execution>
  154.                     <execution>
  155.                         <id>create-procedure</id>
  156.                         <phase>process-test-resources</phase>
  157.                         <goals>
  158.                             <goal>execute</goal>
  159.                         </goals>
  160.                         <configuration>
  161.                             <delimiter>|</delimiter>
  162.                             <autocommit>true</autocommit>
  163.                             <srcFiles>
  164.                                 <srcFile>src/main/resources/sql/procedure.sql</srcFile>
  165.                             </srcFiles>
  166.                         </configuration>
  167.                     </execution>
  168.                     <execution>
  169.                         <id>insert-data</id>
  170.                         <phase>process-test-resources</phase>
  171.                         <goals>
  172.                             <goal>execute</goal>
  173.                         </goals>
  174.                         <configuration>
  175.                             <orderFile>ascending</orderFile>
  176.                             <fileset>
  177.                                 <basedir>${basedir}</basedir>
  178.                                 <includes>
  179.                                     <include>src/main/resources/sql/addTestValues.sql</include>
  180.                                 </includes>
  181.                             </fileset>
  182.                         </configuration>
  183.                     </execution>
  184.                 </executions>
  185.             </plugin>
  186.  
  187.         </plugins>
  188.     </build>
  189.     <dependencies>
  190.         <dependency>
  191.             <groupId>javax.servlet</groupId>
  192.             <artifactId>jstl</artifactId>
  193.             <version>1.2</version>
  194.         </dependency>
  195.  
  196.         <!--For logging file and console-->
  197.         <dependency>
  198.             <groupId>org.slf4j</groupId>
  199.             <artifactId>slf4j-log4j12</artifactId>
  200.             <version>1.6.6</version>
  201.         </dependency>
  202.         <dependency>
  203.             <groupId>log4j</groupId>
  204.             <artifactId>log4j</artifactId>
  205.             <version>1.2.16</version>
  206.         </dependency>
  207.  
  208.         <!--Additional javaFX tools-->
  209.         <dependency>
  210.             <groupId>org.controlsfx</groupId>
  211.             <artifactId>controlsfx</artifactId>
  212.             <version>8.40.12</version>
  213.         </dependency>
  214.  
  215.         <!--For jackson parsing-->
  216.         <dependency>
  217.             <groupId>com.fasterxml.jackson.dataformat</groupId>
  218.             <artifactId>jackson-dataformat-xml</artifactId>
  219.             <version>2.6.3</version>
  220.         </dependency>
  221.         <dependency>
  222.             <groupId>org.apache.commons</groupId>
  223.             <artifactId>commons-lang3</artifactId>
  224.             <version>3.4</version>
  225.         </dependency>
  226.  
  227.         <!--For XML formatting-->
  228.         <dependency>
  229.             <groupId>org.codehaus.woodstox</groupId>
  230.             <artifactId>wstx-asl</artifactId>
  231.             <version>4.0.6</version>
  232.         </dependency>
  233.         <dependency>
  234.             <groupId>mysql</groupId>
  235.             <artifactId>mysql-connector-java</artifactId>
  236.             <version>5.1.9</version>
  237.         </dependency>
  238.  
  239.         <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
  240.         <dependency>
  241.             <groupId>javax.servlet</groupId>
  242.             <artifactId>javax.servlet-api</artifactId>
  243.             <version>3.1.0</version>
  244.             <scope>provided</scope>
  245.         </dependency>
  246.     </dependencies>
  247. </project>
  248.  
  249.  
  250.  
  251.  
  252.  
  253. DataSource dataSource = (DataSource) context.lookup("java:comp/env/jdbc/contact_app")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement