Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 2.93 KB

Using-cmd-line.md

File metadata and controls

77 lines (54 loc) · 2.93 KB

Building and running the sample using the command line

Clone Git Repo

📌 Switch to Eclipse example

$ git clone https://github.com/WASdev/sample.daytrader7.git

Building the sample

📌 Switch to Eclipse example

This sample can be built using either Gradle or Maven.

Gradle commands
$ gradle build

If you want to also run the functional tests then you need to Download WAS Liberty and set the libertyRoot property in the gradle.properties file to point to your Liberty install.

Apache Maven commands
$ mvn install

If you want to also run the functional tests then you need to Download WAS Liberty and pass in the location of your install as the system property libertyRoot:

$ mvn -DlibertyRoot=<LibertyInstallLocation> install

The built ear file is copied into the apps directory of the server configuration located in the daytrader-ee7-wlpcfg directory:

daytrader-ee7-wlpcfg
 +- servers
     +- daytrader-ee7-wlpcfg                   <-- specific server configuration
        +- server.xml                          <-- server configuration
        +- apps                                <- directory for applications
           +- daytrader-ee7.ear                <- sample application
        +- logs                                <- created by running the server locally
        +- workarea                            <- created by running the server locally

Running the application locally

📌 Switch to Eclipse example

Pre-requisite: Download WAS Liberty

Use the following to start the server and run the application:

$ export WLP_USER_DIR=/path/to/sample.daytrader7/daytrader-ee7-wlpcfg
$ /path/to/wlp/bin/server start daytrader7Sample

1.  Confirm web browser opens on "http://localhost:9082/daytrader/" or "http://localhost:9082/daytrader/index.faces"
2.  In the web browser, Click on the configuration tab.
3.  Click on '(Re)-create  DayTrader Database Tables and Indexes' to create the database.
4.  Click on '(Re)-populate  DayTrader Database' to populate the database.
5.  Restart the server-> .  Now the application will be ready for use.
$ /path/to/wlp/bin/server stop daytrader7Sample
$ /path/to/wlp/bin/server start daytrader7Sample
  • start runs the server in the background. Look in the logs directory for console.log to see what's going on, e.g.
  • stop stop the server in the background. Look in the logs directory for console.log to see what's going on, e.g.
  • run runs the server in the foreground.
$ tail -f ${WLP_USER_DIR}/servers/daytrader7Sample/logs/console.log