We have a small java based server (a simple app which fetches data using MySQL and hibernate) which needs to run standalone (e.g. java -cp <....> com.foo.Server
).
Currently we use mvn for the entire build process and use mvn exec:java
(http://mojo.codehaus.org/exec-maven-plugin/java-mojo.html) to run the application using maven.
We would like to package this application with its set of jar dependencies so that I can just use the command given above to run it on a production box (which will not have maven).
Database information present under META-INF\persistence.xml
<property name="hibernate.connection.url" value="jdbc:mysql://192.168.1.1:3306/foo/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.username" value="u1"/>
<property name="hibernate.connection.password" value="u1pass"/>
- How should I package this application or create a deployment image which I can deploy it on a production box.
- How do I pass database credentials to this application in the production box. Currently the information is contained within the access jars (under META-INF\persistence.xml).