Page 1 of 1

Running ToyAppForJPA outside Netbeans or Eclipse

Posted: Tue Mar 10, 2015 9:14 am
by jackstuard
Hi,

If someone would like to run ToyAppForJPA without an IDE here's how I did:

Edit pom.xml and add this dependency under dependencies:

Code: Select all

		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
			<version>10.5.3.0_1</version>
		</dependency>
Open src\main\resources\META-INF\persistence.xml and change:

Code: Select all

<property name="hibernate.connection.url" value="jdbc:derby://localhost:1527/toyjpadb"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.ClientDriver"/>
to

Code: Select all

<property name="hibernate.connection.url" value="jdbc:derby:toyjpadb;create=true"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
Now run the follow command in ToyAppForJPA folder:

Code: Select all

mvn clean install dependency:copy-dependencies
and then to start the App enter the target folder (cd target) and execute:

Code: Select all

java -cp ToyAppForOCPJPA.jar;.\dependency\* guiclient.JPATest
You can create a bat to make easier to start the app.

Re: Running ToyAppForJPA outside Netbeans or Eclipse

Posted: Tue Mar 10, 2015 9:19 am
by admin
Great! Thank you for posting it here. I'm sure it will be helpful for other readers.

-Paul.