Adding Maven library for JPA (Dali) can be performed using Maven Library
provider (placed within the org.jboss.tools.maven.core plugin).
There is already an example for Maven JSF libraries.
Adding Maven library provider requires two steps:
- creating an extension point :
<extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="jsf12-maven-library-provider"
extends="maven-library-provider">
<label>Hibernate Libraries</label>
<param name="template"
value="platform:/plugin/<your_plugin_id>/poms/hibernate-template.xml"/>
<enablement>
<and>
<with variable="projectFacets">
<test property="org.jboss.tools.maven.core.projectFacets"
value="jpt.jpa,jboss.m2" forcePluginActivation="true"/>
</with>
<with variable="requestingProjectFacet">
<test
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jpt.jpa:1.0" forcePluginActivation="true"/>
</with>
</and>
</enablement>
</provider>
</extension>
- creating hibernate_template.xml
It is Maven pom.xml file that contains required dependencies, plugins,
repositories for the library provider.
It is possible to create different library providers for Hibernate,
Eclipselink ... as well as for different versions of libraries and facets.
I have created
https://jira.jboss.org/jira/browse/JBIDE-4688 for adding
Maven JPA libraries.
In order to add Maven library provider for other facets (Seam, Portlet,
WS, ESB ...), it is necessary to configure the wizardPages ext. point to
use WTP 3.1 Library Framework. The JPA and JSF facet already use this
framework. I have created
https://jira.jboss.org/jira/browse/JBIDE-4689
to track integrating the Portlet facet with WTP 3.1 Library Provider.
Maven Library Provider requires m2eclipse and the JBoss Maven
Integration facet (jboss.m2).
Snjeza
Max Rydahl Andersen wrote:
btw. if we could add a way to use maven repositories as the
implementation for getting these libraries *that* would be interesting.
Then at least we dont need to maintain a separate download system.
still the problem of eclipse user libraries being non-sharable remains.
/max
Dmitry Geraskov wrote:
> Hi, guys,
> I find the solution which Dali uses for libmanagement on project
> creation step.
> They have composite which allows to user to add libraries when he create
> project.
>
>
> The libraries could be managed by eclipse's preferences, or could be
> downloaded from the internet.
>
>
>
>
>
> This is standard feature for faceted projects.
> (see
> org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate,
> org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi)
> ---
>
> If we want some *specific* libraries to be added (or we want to help to
> user) we could do it like dtp helps with jdbc drivers when you creates
> new ConnectionProfile.
>
>
>
> Is this we are looking for libmanagement?
>
>
> --
> Best regards,
>
> Dmitry Geraskov
> dgeraskov(a)exadel.com
> Senior Developer
> Exadel Inc
>
------------------------------------------------------------------------
_______________________________________________
jbosstools-dev mailing list
jbosstools-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbosstools-dev