type=page
status=published
title=Running the Duke's Bookstore Case Study Application
next=dukes-tutoring.html
prev=dukes-bookstore002.html
~~~~~~
Running the Duke's Bookstore Case Study Application
===================================================

[[GLPPQ]]

[[running-the-dukes-bookstore-case-study-application]]
Running the Duke's Bookstore Case Study Application
---------------------------------------------------

You can use either NetBeans IDE or Maven to build, package, deploy, and
run the Duke's Bookstore application.

The following topics are addressed here:

* link:#GLPQG[To Build and Deploy Duke's Bookstore Using NetBeans IDE]
* link:#GLPQN[To Build and Deploy Duke's Bookstore Using Maven]
* link:#BABEHDEG[To Run Duke's Bookstore]

[[GLPQG]]

[[to-build-and-deploy-dukes-bookstore-using-netbeans-ide]]
To Build and Deploy Duke's Bookstore Using NetBeans IDE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.  Make sure that GlassFish Server has been started (see
link:usingexamples002.html#BNADI[Starting and Stopping GlassFish
Server]).
2.  From the File menu, choose Open Project.
3.  In the Open Project dialog box, navigate to:
+
[source,oac_no_warn]
----
tut-install/examples/case-studies
----
4.  Select the `dukes-bookstore` folder.
5.  Click Open Project.
6.  In the Projects tab, right-click the `dukes-bookstore` project and
select Build.
+
This will build, package, and deploy Duke's Bookstore to GlassFish
Server.

[[GLPQN]]

[[to-build-and-deploy-dukes-bookstore-using-maven]]
To Build and Deploy Duke's Bookstore Using Maven
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.  Make sure that GlassFish Server has been started (see
link:usingexamples002.html#BNADI[Starting and Stopping GlassFish
Server]), as well as the database server (see
link:usingexamples004.html#BNADK[Starting and Stopping Apache Derby]).
2.  In a terminal window, go to:
+
[source,oac_no_warn]
----
tut-install/examples/case-studies/dukes-bookstore/
----
3.  Enter the following command:
+
[source,oac_no_warn]
----
mvn install
----
+
This command builds the application and packages it in a WAR file in the
`_tut-install_/examples/case-studies/dukes-bookstore/target/` directory.
It then deploys the application to GlassFish Server.

[[BABEHDEG]]

[[to-run-dukes-bookstore]]
To Run Duke's Bookstore
~~~~~~~~~~~~~~~~~~~~~~~

1.  In a web browser, enter the following URL:
+
[source,oac_no_warn]
----
http://localhost:8080/dukes-bookstore/
----
2.  On the Duke's Bookstore main page, click a book in the graphic, or
click one of the links at the bottom of the page.
3.  Use the pages in the application to view and purchase books.
