Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Automatically deploy jar file when deploying web application
Automatically deploy jar file when deploying web application [message #204841] Thu, 22 November 2007 11:44 Go to next message
Marcos is currently offline MarcosFriend
Messages: 68
Registered: July 2009
Member
- Eclipse 3.3.1
- WTP 2.0.1

Hello, everybody!

I have a utility jar file that I use in all my applications (web and
desktop).
But the problem is that, in the case of the web applications, every time
that
I generate this jar file again (due to some update in their classes,
for example) I have to copy it to the lib directory of the application
server
(I'm using JBoss, so I place my utility jars there). So, this takes time
and
it is also error prone, in the case that I could forget to copy the file
to the
lib directory.

I would like to have a way to update the jar file automatically to the
application server when I deploy my web application, without the need to
explicitly copy it. Is there a way WTP can help me achieve this,
automatizing
my development process?

Thank you.

Marcos
Re: Automatically deploy jar file when deploying web application [message #204878 is a reply to message #204841] Fri, 23 November 2007 21:56 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
Hi Marcos,

If you're deploying to your server using the WTP server controls you can
create a J2EE Utility Project and specify that your Web project depends on
the utility project. WTP will then bundle the utility project with your
Web app before automatically deploying it to the server.

If you're deploying to your server without WTP's help I'd integrate this
into your build process. That way each time there is an update to your
utility project you simply rebuild your Web app automatically pulling in
the changes and then redeploy your entire Web app.

Lawrence
Re: Automatically deploy jar file when deploying web application [message #204935 is a reply to message #204878] Mon, 26 November 2007 11:47 Go to previous messageGo to next message
Marcos is currently offline MarcosFriend
Messages: 68
Registered: July 2009
Member
Hi, Lawrence.

lmandel@ca.ibm.com wrote:

> If you're deploying to your server using the WTP server controls you can
> create a J2EE Utility Project and specify that your Web project depends on
> the utility project. WTP will then bundle the utility project with your
> Web app before automatically deploying it to the server.

Yes, I'm using the WTP server controls and I'll try the J2EE Utility
Project to solve my problem as you suggested to me. But I have just one
doubt about the behavior of the Utility Project: as I said, I'm using
JBoss and I place my utility jar file in the server lib directory, so all
my web applications in the deploy directoy can see it. Can I specify to
the Utility Project that I want my jar file deployed to the server lib
directory or is it deployed by default in another way, to another
location? To be sincere I don't mind where the Utility Project deploy the
jar file, since my web application will still be able to see it.

Thank you.

Marcos
Re: Automatically deploy jar file when deploying web application [message #204957 is a reply to message #204935] Mon, 26 November 2007 17:43 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
Hi Marcos,

>Can I specify to
>the Utility Project that I want my jar file deployed to the server lib
>directory or is it deployed by default in another way, to another
>location?

No. The utility project will be automatically deployed to your Web app's
lib directory. If you want to deploy to another location (such as the
server lib directory) I'd create a simple Ant task and hook up it up as an
Eclipse builder for your project. (You can hook up any Ant task as an
Eclipse builder.) Then, when you rebuild your utility project your Ant
task will get invoked and your utility project will automatically get
deployed.

Lawrence
Re: Automatically deploy jar file when deploying web application [message #204987 is a reply to message #204957] Tue, 27 November 2007 11:24 Go to previous message
Marcos is currently offline MarcosFriend
Messages: 68
Registered: July 2009
Member
Thank you, Lawrence.

Marcos
Previous Topic:Corollary to org.eclipse.jst.component.dependency in WTP 1.5
Next Topic:Eclipse plug in for JRUN
Goto Forum:
  


Current Time: Sat Dec 20 18:41:00 GMT 2014

Powered by FUDForum. Page generated in 0.01645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software