Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » WTP: packaging possible like war/ear?(is packaging possible with WTP)
WTP: packaging possible like war/ear? [message #549615] Tue, 27 July 2010 11:33 Go to next message
Barry  is currently offline Barry
Messages: 13
Registered: July 2010
Junior Member
Is it possible to do packaging with WTP or J2EE?
After creating a new faceted dynamic web project, we like to use WTP also to create wars, jars, and an ear in the end.
Is this possible, has somebody code examples?

What other ways can be used, if WTP is not the right tool?


Thank You!

Barry
Re: WTP: packaging possible like war/ear? [message #549652 is a reply to message #549615] Tue, 27 July 2010 13:09 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/27/2010 5:33 AM, Barry wrote:
> Is it possible to do packaging with WTP or J2EE?
> After creating a new faceted dynamic web project, we like to use WTP
> also to create wars, jars, and an ear in the end.
> Is this possible, has somebody code examples?
>
> What other ways can be used, if WTP is not the right tool?
>
>
> Thank You!
>
> Barry

Do you mean such as is done by Eclipse when you...

1) Right-click on your project
2) Choose Export
3) Choose and export destination like
Java -> JAR file
Java EE -> EAR file
Web -> WAR file

?
Re: WTP: packaging possible like war/ear? [message #549660 is a reply to message #549652] Tue, 27 July 2010 13:44 Go to previous messageGo to next message
Barry  is currently offline Barry
Messages: 13
Registered: July 2010
Junior Member
YES! How is it done via the WTP API (where are the tools located)?
I wish to use those tools without GUI.


Thank You!

Barry
Re: WTP: packaging possible like war/ear? [message #549849 is a reply to message #549660] Wed, 28 July 2010 08:32 Go to previous messageGo to next message
Barry  is currently offline Barry
Messages: 13
Registered: July 2010
Junior Member
I have it!

IVirtualComponent component = ComponentCore.createComponent(project);
WebComponentExportDataModelProvider provider = new WebComponentExportDataModelProvider();
IDataModel createDataModel = DataModelFactory.createDataModel(provider);
createDataModel.setStringProperty(IJ2EEComponentExportDataMo delProperties.ARCHIVE_DESTINATION, "C:/development/abc.war");
createDataModel.setBooleanProperty(IJ2EEComponentExportDataM odelProperties.OVERWRITE_EXISTING, Boolean.TRUE);
createDataModel.setStringProperty(IJ2EEComponentExportDataMo delProperties.PROJECT_NAME, "infinity");
createDataModel.setProperty(IJ2EEComponentExportDataModelPro perties.COMPONENT, component);
provider.setDataModel(createDataModel);
J2EEArtifactExportOperation defaultOperation = (J2EEArtifactExportOperation) provider.getDefaultOperation();

try
{
defaultOperation.execute(new NullProgressMonitor(), null);
}
catch (ExecutionException e)
{
}
Re: WTP: packaging possible like war/ear? [message #549850 is a reply to message #549652] Wed, 28 July 2010 08:36 Go to previous messageGo to next message
Barry  is currently offline Barry
Messages: 13
Registered: July 2010
Junior Member
Hi Russell,

you see, I have send in another reply how the solution looks like and it works too.

Maybe you can help me with 2 other tasks (always headless WTP)?

1st problem:
how do I deploy such a war or ear?

2nd problem:
how can I create modify app server specific deployment descriptors like jboss-web.xml (and xmi files) with WTP?
What would be the best way?


Thank You!

Barry
Re: WTP: packaging possible like war/ear? [message #549930 is a reply to message #549850] Wed, 28 July 2010 13:30 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3221
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/28/2010 2:36 AM, Barry wrote:
> Hi Russell,
>
> you see, I have send in another reply how the solution looks like and it
> works too.
>
> Maybe you can help me with 2 other tasks (always headless WTP)?
>
> 1st problem:
> how do I deploy such a war or ear?
>
> 2nd problem:
> how can I create modify app server specific deployment descriptors like
> jboss-web.xml (and xmi files) with WTP?
> What would be the best way?
>
>
> Thank You!
>
> Barry

1) I always deploy merely by dropping the WAR file into the webapps
subdirectory, bouncing Tomcat and I'm going.

2) I don't know the answer to this question as it's not something I do.
Previous Topic:autocomplete doesn't work with dojo
Next Topic:How to reference a project as an dependency for Dynamic web project
Goto Forum:
  


Current Time: Thu Oct 23 15:12:42 GMT 2014

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

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