|
Re: How to: create DWP programmatically? [message #668192 is a reply to message #667985] |
Wed, 04 May 2011 12:42 |
Prasanna K Messages: 78 Registered: July 2009 |
Member |
|
|
Created a dwp manually using eclipse.
Tried to create a dwp programmatically so that its .project matches that of created by Eclipse.
Project gets created fine. (both .project files are same).
But there is no .classpath file in the project dir.
Also I'm not able to link the sources and add external jars to classpath. When I link the sources, the package structure doesn't match the one on the disk.
Here is the code (thus far):
private void createDWP(IProject project) throws CoreException {
IFacetedProject facetedProject =
ProjectFacetsManager.create(project, true, null);
IProjectDescription description = project.getDescription();
description.setNatureIds(new String[]
{"org.eclipse.jem.workbench.JavaEMFNature",
"org.eclipse.jdt.core.javanature",
"org.eclipse.wst.common.project.facet.core.nature",
"org.eclipse.wst.common.modulecore.ModuleCoreNature",
"org.eclipse.wst.jsdt.core.jsNature"});
project.setDescription(description, null);
IProjectFacet wstWebFacet = ProjectFacetsManager.getProjectFacet
(IModuleConstants.WST_WEB_MODULE);
facetedProject.installProjectFacet
(wstWebFacet.getDefaultVersion(), null, null);
}
How does one add source and lib entries to a DynamicWebProject (facetedproject) programmatically?
Please guide.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02982 seconds