5.
Deploying a Project
Deploying Web Projects or Enterprise Projects to your WebSphere
application server from MyEclipse are very similar processes,
straight forward and can be done in two different ways:
-
Traditional - Using the deployment tool you specify the project
you want to deploy, which server you want to deploy it to and
the type of deployment; MyEclipse then deploys it.
-
Automatic - Using the "Run As" or "Debug As"
menus and selecting
MyEclipse Server Application, MyEclipse will
automatically package and deploy your project to the server of
choice, then (re)start the server automatically. If the
deployment already exists it is updated then the server
(re)started automatically.
We will show you both methods of deploying a project, starting
with Traditional first.
Even though the screenshots below show the
process for a Web Project, deploying an Enterprise Project works
in exactly the same way. When you deploy the Enterprise Project
using either the Traditional or Automatic methods, the Enterprise
Project is packaged up into an EAR, containing all it's modules
and deployed.
5.1
Traditional Deployment
As an example of a Web Project, we will use the GoogleMapsExample
from the
Examples On-Demand
service:
To create a deployment of this project to WebSphere, we can
do this two different ways:
-
Using the deployment tool button from the toolbar
-
Using the deployment button from the
Servers view
In this case let's use the deployment tool button from the
toolbar:
NOTE:
The application server can either be running or stopped
when the deployment is created. Both will work.
When the deployments dialog opens, first you want to select the
Project you wish to deploy,
then click the
Add button:
On the following screen you have to select the
Server you wish to deploy the project to then
hit
Finish:
Optionally you can adjust if the deployment is
Exploded (for development, where each change is
synchronized with the server as the file is saved) or
Packaged (for production, where a WAR or EAR is created
and deployed only when the developer comes to this dialog and hits
the
Deploy button). Choosing either is technically
fine, but using the default of
Exploded will provide faster development cycles for you
as your changes are pushed out to the server instantly (hot-sync'ed).
After clicking
Finish, the deployment tool will deploy your
project directly into WebSphere automatically, with no need to
load the administrative console and finish it yourself:
After the project has been deployed to WebSphere, the deployment
tool will provide a
Successful indicator to you (or a warning/error message
if necessary) letting you know the status of the deployment:
Additionally, WebSphere will log the deployment process to the
Console view if you want to examine it for any
reason. The important line of the log to notice is the last line
stating:
Application started: <Your application name>
5.2
Automatic Deployment
Now, assuming you don't want to manage your project deployments
yourself or your server running state, and just let MyEclipse
Blue handle all of that for you, you can use Automatic
deployment.
Automatic deployment works by using two new
Run As or
Debug As menu items that exist in the context menu for a
project; it is called
MyEclipse Server Application:
When you click that menu item, MyEclipse will then prompt you to
select the application server you want to run your project on:
After selecting the server, MyEclipse will automatically deploy
your application in
Exploded mode to that application server, then (re)start
that server for you.
If you open the deployment tool or focus the
Servers view, you'll notice the application
server you ran your project on now has a deployment registered
with it and in the application server
Console view (WebSphere in this case) you'll
likely see log messages reflecting the application server status
and the new deployment that was automatically sent to it:
An important thing to remeber is that projects deployed this way
are exactly the same as any other project. To remove the
deployment you can use the
Servers view or the deployment tool directly as
noted above with Traditional Deployments; these are no different
to manage.
|