WST project creation question [message #230205] |
Wed, 08 April 2009 18:21  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
I am using code similar to the following to create a WTP project:
IDataModel model = DataModelFactory.createDataModel((IDataModelProvider)
IWebFacetInstallDataModelProperties._provider_class.newInsta nce());
IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy)
model.getProperty(IFacetProjectCreationDataModelProperties.F ACETED_PROJECT_WORKING_COPY);
IFacetedProjectTemplate template =
ProjectFacetsManager.getTemplate("template.jst.web"); //$NON-NLS-1$
fpwc.setProjectName(projectName);
fpwc.setFixedProjectFacets(template.getFixedProjectFacets()) ;
fpwc.setTargetedRuntimes(Collections.<IRuntime> emptySet());
model.setProperty(IFacetProjectCreationDataModelProperties.F ACET_RUNTIME, fpwc.getPrimaryRuntime());
fpwc.commitChanges(progress);
IProject project = fpwc.getProject();
The problem is, the created project is using the workspace default JRE
on its build path. That is a problem for portability of projects
(export/import, CVS check-in, etc.) so we prefer to use an Execution
Environment instead.
Is there any way to instruct WST to create the project using an
Execution Environment? I know I can explicitly remove the JRE and add an
EE directly, but I was hoping there is a simpler method to get WST to do it.
TIA,
Eric
|
|
|
|
Re: WST project creation question [message #230313 is a reply to message #230223] |
Mon, 13 April 2009 20:28  |
Eclipse User |
|
|
|
Hi Eric,
The runtime modeling component of faceted project framework has no support
for anything equivalent to JDT's Execution Environment concept. When you
target a runtime, you are targeting a specific one. This includes the
specific JRE that is associated with that runtime. This could be an
interesting enhancement for after Galileo.
Now, the no runtime case is a bit special. When no runtime is specified,
facets are free to do what they choose with their classpath. In the case
of the java facet, the current implementation just latches onto the
default vm. Perhaps a better solution would be to latch on to the java
execution environment that corresponds to the facet version. This can
happen for Galileo, but will only benefit users in the no runtime
scenario. Do you want to open an enhancement request for this?
- Konstantin
|
|
|
Powered by
FUDForum. Page generated in 0.24762 seconds