Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 KB | None | 0 0
  1. public class Main {
  2. public static void main(String[] args) {
  3. String currentDir = null;
  4. try {
  5. currentDir = new File(".").getCanonicalPath();
  6. LOG.info("Current application directory: " + currentDir);
  7. } catch (IOException e) {
  8. e.printStackTrace();
  9. }
  10. String war = currentDir + "\target\app.war";
  11. String tomeeConf = currentDir + "\src\main\tomee\conf\tomee.xml";
  12.  
  13. // ARGUMENTS
  14. String[] setup = { "--path", war, "--tomeexml", tomeeConf };
  15. try {
  16. // PROGRAM:
  17. org.apache.tomee.embedded.Main.main(setup);
  18.  
  19. } catch (Exception e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
  24.  
  25. <?xml version="1.0" encoding="UTF-8"?>
  26. <tomee>
  27. <!-- Connection details specified in src/main/resource/persistence.xml -->
  28. <Resource id="APP-DATA" type="javax.sql.DataSource">
  29. IgnoreDefaultValues true
  30. JdbcDriver com.mysql.jdbc.Driver
  31. JdbcUrl jdbc:mysql://localhost:3306/scc-data
  32. UserName admin
  33. Password pass
  34. JtaManaged true
  35. </Resource>
  36. </tomee>
  37.  
  38. <project xmlns="http://maven.apache.org/POM/4.0.0"
  39. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  40. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  41. http://maven.apache.org/xsd/maven-4.0.0.xsd">
  42. <modelVersion>4.0.0</modelVersion>
  43. <groupId>rfpeake</groupId>
  44. <artifactId>theapp-parent</artifactId>
  45. <version>0.0.1-SNAPSHOT</version>
  46. <packaging>pom</packaging>
  47. <name>theapp</name>
  48. <description>Database project</description>
  49.  
  50. <modules>
  51. <module>../theapp-app</module>
  52. </modules>
  53.  
  54. <properties>
  55. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  56. <tomee.version>7.0.3</tomee.version>
  57. <tomee.classifier>webprofile</tomee.classifier>
  58. <mysql-connector-version>5.1.40</mysql-connector-version>
  59. <hibernate.version>5.2.9.Final</hibernate.version>
  60. <primefaces.version>6.1</primefaces.version>
  61. </properties>
  62.  
  63. <dependencies>
  64.  
  65. <!-- TOMEE EMBEDDED -->
  66. <dependency>
  67. <groupId>org.apache.tomee</groupId>
  68. <artifactId>tomee-embedded</artifactId>
  69. <version>${tomee.version}</version>
  70. </dependency>
  71.  
  72. <!-- Declaration for JSF 2.2 with Tomee 7 -->
  73. <dependency>
  74. <groupId>javax</groupId>
  75. <artifactId>javaee-web-api</artifactId>
  76. <version>7.0</version>
  77. <scope>provided</scope>
  78. </dependency>
  79.  
  80. <!-- JPA spec [required] -->
  81. <dependency>
  82. <groupId>org.apache.geronimo.specs</groupId>
  83. <artifactId>geronimo-jpa_2.0_spec</artifactId>
  84. <version>1.1</version>
  85. <scope>provided</scope>
  86. </dependency>
  87.  
  88. <!-- Hibernate -->
  89. <dependency>
  90. <groupId>org.hibernate</groupId>
  91. <artifactId>hibernate-core</artifactId>
  92. <version>${hibernate.version}</version>
  93. <scope>provided</scope>
  94. </dependency>
  95.  
  96. <!-- Hibernate EHCache -->
  97. <dependency>
  98. <groupId>org.hibernate</groupId>
  99. <artifactId>hibernate-ehcache</artifactId>
  100. <version>${hibernate.version}</version>
  101. </dependency>
  102.  
  103. <!-- Primefaces -->
  104. <dependency>
  105. <groupId>org.primefaces</groupId>
  106. <artifactId>primefaces</artifactId>
  107. <version>${primefaces.version}</version>
  108.  
  109. <!-- JUnit -->
  110. <dependency>
  111. <groupId>junit</groupId>
  112. <artifactId>junit</artifactId>
  113. <version>3.8.1</version>
  114. <scope>test</scope>
  115. </dependency>
  116. </dependencies>
  117.  
  118. </project>
  119.  
  120. <project xmlns="http://maven.apache.org/POM/4.0.0"
  121. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  122. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  123. http://maven.apache.org/xsd/maven-4.0.0.xsd">
  124. <modelVersion>4.0.0</modelVersion>
  125.  
  126. <parent>
  127. <groupId>rfpeake</groupId>
  128. <artifactId>theapp-parent</artifactId>
  129. <version>0.0.1-SNAPSHOT</version>
  130. <relativePath>../theapp-parent/pom.xml</relativePath>
  131. </parent>
  132.  
  133. <artifactId>theapp-app</artifactId>
  134. <packaging>war</packaging>
  135. <name>Database Application</name>
  136.  
  137. <build>
  138. <finalName>theapp</finalName>
  139.  
  140. <!-- pluginManagement tag required in Eclipse to avoid error:
  141. Plugin execution not covered by lifecycle configuration. -->
  142. <pluginManagement>
  143. <plugins>
  144. <plugin>
  145. <groupId>org.apache.tomee.maven</groupId>
  146. <artifactId>tomee-embedded-maven-plugin</artifactId>
  147. <version>${tomee.version}</version>
  148. <configuration>
  149. <tomeeVersion>${tomee.version}</tomeeVersion>
  150. <tomeeClassifier>
  151. ${tomee.classifier}</tomeeClassifier>
  152. <synchronization>
  153. <extensions>
  154. <!-- To update each time app built
  155. with mvn compile -->
  156. <extension>.class</extension>
  157. <extension>.properties</extension>
  158.  
  159. <extension>.css</extension>
  160. </extensions>
  161. <updateInterval>2</updateInterval>
  162. </synchronization>
  163. <!-- For some reason, must to be false
  164. or reloading does not work! -->
  165.  
  166. <reloadOnUpdate>false</reloadOnUpdate>
  167.  
  168. <warFile>
  169. ${project.build.directory}/${project.build.finalName}
  170. </warFile>
  171. <!-- path tused by tomEE in the tomee:deploy and
  172. tomee:undeploy goals -->
  173. <path>
  174. ${project.build.directory}/apache- tomee/webapps${project.build.finalName}
  175. </path>
  176. <args>
  177. -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server
  178. -Xms128m -Xmx4096m -XX:PermSize=196m -XX:MaxPermSize=128m
  179. -XX:+DisableExplicitGC</args>
  180. <libs>
  181. <lib>
  182. mysql:mysql-connector-java:${mysql-connector-version}
  183. </lib>
  184. </libs>
  185. </configuration>
  186. <dependencies>
  187. <dependency>
  188. <groupId>org.apache.tomee</groupId>
  189. <artifactId>apache-tomee</artifactId>
  190. <version>${tomee.version}</version>
  191. <classifier>${tomee.classifier}</classifier>
  192. <type>zip</type>
  193. <!-- set this to runtime for it to work -->
  194. <scope>runtime</scope>
  195. </dependency>
  196. </dependencies>
  197. </plugin>
  198. <plugin>
  199. <groupId>org.apache.maven.plugins</groupId>
  200. <artifactId>maven-compiler-plugin</artifactId>
  201. <version>2.3.2</version>
  202. <configuration>
  203. <source>1.7</source>
  204. <target>1.7</target>
  205. <showDeprecation>true</showDeprecation>
  206. </configuration>
  207. </plugin>
  208. </plugins>
  209. </pluginManagement>
  210. </build>
  211. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement