I have noticed that you wrote most of the facet stuff in the mentioned package. I try to create a new facet headless via WTP to a new project.
I add the nature with WtpUtils.addNatures(project); I like to create a dynamic web project with only a base facet like IJ2EEFacetConstants.DYNAMIC_WEB_24, but even trying 2 days, I fail.
Do you have a hint, how to do this with only a few lines?

There are various versions of ProjectFacetsManager.create() method that are appropriate for different cases. There is no need to call WtpUtils.addNatures(). That's encapsulated in installation of the web facet.

You can substitute constants for appropriate IProjectFacet and IProjectFacetVersion objects from IJ2EEFacetConstants class.

> it finally works, but how do I use
> fproj.addTargetedRuntime( ..., null );
> ... how do I create a Runtime for this api call?

You can retrieve an IRuntime instance using RuntimeManager.getRuntime( name ) API. Note that the runtime must already be defined by the time you make this call.

Faceted project framework does not deal with actually defining runtimes. That's up to technologies that use the framework. For Java EE servers, you should use API in org.eclipse.wst.server.core plugin to define a runtime.

> it finally works, but how do I use
> fproj.addTargetedRuntime( ..., null );
> ... how do I create a Runtime for this api call?

You can retrieve an IRuntime instance using RuntimeManager.getRuntime( name ) API. Note that the runtime must already be defined by the time you make this call.

Faceted project framework does not deal with actually defining runtimes. That's up to technologies that use the framework. For Java EE servers, you should use API in org.eclipse.wst.server.core plugin to define a runtime.