Link to home
Start Free TrialLog in
Avatar of CodingExperts
CodingExperts

asked on

ANT : Creating deployment profile

Hi all,

The challange is to incorporate and automate the build mechanism for any project in Eclipse, and it should be transparent to the developers. I need to automate the creation of war/ear  using which the developers can include/exclude the files/ filesets.

It is basically like creating deployment profile.

I could have done it using ANT scripts which I give to the devlopers and they could change the script acc to generate the war/ear.But I would pre4fer a transparent mechanism.

All I need is the best stratergy to acheive this. Implementation details can be an add-on.

-CE
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

What kind of interface are you talking about - drag and drop?
Avatar of CodingExperts
CodingExperts

ASKER

>> drag and drop?

Nope, may be a JTree kinda thing with checkboxes.

I want to do smthg to automate the inclusion and exclusion of files for war/ear creation, it need not be an GUI implementation.

All i want to do is make the ANT script transparent to the developers, say i can read from a file etc.
I hope you understand. One important thing is that they should be able to save this profile, for later use, and can be used across for all developers.

-CE
All you need to do is build the Ant task programmatically with its API
(much like the guy a few questions down is doing)
(Or *up* i should say ;-))
One more important thing. I want to launch it from Eclipse IDE as though a part of IDE.

What kind of strategy/design do you propose ???

-CE
Well i'm not really familiar with Eclipse, but you'd probably have to use *its* API too
mh, what about using lomboz (http://forge.objectweb.org/projects/lomboz) for developing your J2EE webapplications? There it is simple to deploy/undeploy any web-project you like to specified application server.
Do you have in mind, to develop a eclipse plugin?
I have that thing in mind. How much time do you think it should take??.

for the moment I am trying to Load an XML file in ANT and then process the input.

http://ant.apache.org/manual/CoreTasks/loadfile.html
http://ant.apache.org/manual/CoreTypes/filterchain.html

If you have seen the war/ear deployment profile creator in JDeveloper you can easily figure out what i am looking for.

-CE
There are several useful links here, including ones about plugin development
>>If you have seen the war/ear deployment profile creator in JDeveloper

You could probably link into:

http://ant.apache.org/manual/CoreTasks/ear.html
http://ant.apache.org/manual/CoreTasks/war.html
CEHJ, I have already read the entire ANT mannual.

-CE
>>I have already read the entire ANT mannual

Useful, but it's the ANT api that's key here i would imagine ...
>>Useful, but it's the ANT api that's key here i would imagine ...

I have worked with ANT api before too, and extended them too so that should not be a problem.


CEHJ, I have decided on the stratergy,
I am trying to make a small program which will parse an XML file which will include
<defaultfilesexcluded>
</defaultfilesexcluded>

<filepatternexcluded>
</filepatternsexcluded>

<projectdir>
</projectdir>

etc. entries, which are parsed and a custom build file is generated on the fly, which is then run to get the desired effect. I plan to convert it to a plugin in Eclipse.Do you think this is a right way to do what i wanted to acheive??

Look my plans are to deploy the ear file from the eclipse directly to our dev environment, which is on Oracle9iAS. We already have certain Deploment tasks (Java web application) running on our development environment , which we plan to expose as web-services. Can you suggest How should we go about this entire thing???How much is it feasible ?? (Again i am simply looking for a stratergy or design. i'll code it myself, don't worry about that. ;-) )

-CE


>>I am trying to make a small program which will parse an XML file which will include ...

But there's already a program that does that - it's called  .... Ant :-)

I don't see at first glance what adding a layer of indirection to Ant is going to do for you
>>I don't see at first glance what adding a layer of indirection to Ant is going to do for you
I donot want the Development teams to fiddle with the ANT script.

-CE
OK - i see - you'd like to keep the build script as a template and simply alter parts of it?

In that case you could simply fill the template with parameters, e.g.:

                  <fileset file="${up}" />
and to obtain these parameters, you could code a plugin which delivers a new view to the eclipse ide...
some resources are:

SWT in eclipse:
http://www.developer.com/java/other/article.php/10936_3330861_6

rcp tutorial (plugin development basics, the references on the bottom of the page will take you further):
http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html

google delivers some good resources, too!
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial