Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <Context path="/ContactApp">
- <Resource
- driverClassName="com.mysql.jdbc.Driver"
- maxActive="4"
- maxIdle="2"
- maxWait="5000"
- name="jdbc/contact_app"
- username="root"
- password="root"
- type="javax.sql.DataSource"
- url="jdbc:mysql://localhost:3306/contact_app"
- validationQuery="SELECT 1">
- </Resource>
- </Context>
- <?xml version="1.0" encoding="UTF-8"?>
- <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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>ContactApp</groupId>
- <artifactId>ContactApp</artifactId>
- <name>ContactApp</name>
- <version>1.0-SNAPSHOT</version>
- <packaging>war</packaging>
- <organization>
- <name>ContactApp</name>
- </organization>
- <build>
- <finalName>ContactApp</finalName>
- <plugins>
- <!--<plugin>-->
- <!--<groupId>org.apache.tomcat.maven</groupId>-->
- <!--<artifactId>tomcat7-maven-plugin</artifactId>-->
- <!--<version>2.2</version>-->
- <!--<configuration>-->
- <!--<url>http://172.18.0.2:8080/manager/text</url>-->
- <!--<path>/src</path>-->
- <!--<contextReloadable>true</contextReloadable>-->
- <!--</configuration>-->
- <!--</plugin>-->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>3.0.0</version>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.9</version>
- </dependency>
- </dependencies>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
- </manifest>
- </archive>
- <webResources>
- <resource>
- <!-- this is relative to the pom.xml directory -->
- <directory>${project.basedir}/src/main/resources
- </directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.tomcat.maven</groupId>
- <artifactId>tomcat7-maven-plugin</artifactId>
- <version>2.2</version>
- <executions>
- <execution>
- <id>tomcat-run</id>
- <goals>
- <goal>run-war</goal>
- </goals>
- <phase>install</phase>
- <configuration>
- <port>8080</port>
- <path>/ContactApp</path>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!--Plugin for MySql DB-->
- <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>5.1.9</version>
- </dependency>
- </dependencies>
- <configuration>
- <driver>com.mysql.jdbc.Driver</driver>
- <url>jdbc:mysql://localhost:3306/</url>
- <username>root</username>
- <password>root</password>
- </configuration>
- <executions>
- <execution>
- <id>drop-schema</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <autocommit>true</autocommit>
- <srcFiles>
- <srcFile>src/main/resources/sql/dropdb.sql</srcFile>
- </srcFiles>
- </configuration>
- </execution>
- <execution>
- <id>create-schema</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <autocommit>true</autocommit>
- <srcFiles>
- <srcFile>src/main/resources/sql/create.sql</srcFile>
- </srcFiles>
- </configuration>
- </execution>
- <execution>
- <id>create-procedure</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <delimiter>|</delimiter>
- <autocommit>true</autocommit>
- <srcFiles>
- <srcFile>src/main/resources/sql/procedure.sql</srcFile>
- </srcFiles>
- </configuration>
- </execution>
- <execution>
- <id>insert-data</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <orderFile>ascending</orderFile>
- <fileset>
- <basedir>${basedir}</basedir>
- <includes>
- <include>src/main/resources/sql/addTestValues.sql</include>
- </includes>
- </fileset>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- </dependency>
- <!--For logging file and console-->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.6.6</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- </dependency>
- <!--Additional javaFX tools-->
- <dependency>
- <groupId>org.controlsfx</groupId>
- <artifactId>controlsfx</artifactId>
- <version>8.40.12</version>
- </dependency>
- <!--For jackson parsing-->
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-xml</artifactId>
- <version>2.6.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.4</version>
- </dependency>
- <!--For XML formatting-->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>4.0.6</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.9</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </project>
- DataSource dataSource = (DataSource) context.lookup("java:comp/env/jdbc/contact_app")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement