Author: fbricon
Date: 2012-10-01 12:50:11 -0400 (Mon, 01 Oct 2012)
New Revision: 44184
Added:
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate332-template.xml
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate36X-template.xml
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate41X-template.xml
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/HibernateLibValidator.java
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
Removed:
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate332-template.xml
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate36X-template.xml
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate41X-template.xml
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.xml
Log:
JBIDE-11997 Move the hibernate templates and library providers out of
org.jboss.tools.maven.core into org.jboss.tools.maven.hibernate
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-10-01
16:13:01 UTC (rev 44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-10-01
16:50:11 UTC (rev 44184)
@@ -24,8 +24,6 @@
org.eclipse.m2e.model.edit;bundle-version="[1.0,2.0)";visibility:=reexport,
org.eclipse.core.expressions,
org.eclipse.jdt.ui;bundle-version="3.7.0",
- org.eclipse.jpt.common.core;bundle-version="1.0.0",
- org.eclipse.jpt.jpa.core,
org.eclipse.wst.common.emfworkbench.integration,
org.eclipse.m2e.wtp;bundle-version="0.16.0";resolution:=optional
Bundle-ActivationPolicy: lazy
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-10-01 16:13:01
UTC (rev 44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-10-01 16:50:11
UTC (rev 44184)
@@ -4,13 +4,9 @@
JBoss_Maven_Integration=JBoss Maven Integration
Adds_support_for_Maven=Adds support for Maven.
Maven_library_provider=Maven library provider
-Maven_Hibernate_library_provider=Maven Hibernate library provider
Maven_JSF_1_2_Libraries=Maven JSF 1.2 Libraries
Maven_JSF_1_1_Libraries=Maven JSF 1.1 Libraries
Maven_JSF_2_0_Libraries=Maven JSF 2.0 Libraries
-Hibernate_3_3_2_Libraries=Hibernate 3.3.2 Libraries
-Hibernate_3_6_X_Libraries=Hibernate 3.6.10 Libraries
-Hibernate_4_1_X_Libraries=Hibernate 4.1.0 Libraries
Maven_Portlet_1_0_Libraries=Maven Portlet 1.0 Libraries
Maven_Portlet_2_0_Libraries=Maven Portlet 2.0 Libraries
Maven_Portletbridge_2_0_0_ALPHA_Libraries=Maven Portletbridge 2.0.0 ALPHA Libraries
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-10-01 16:13:01 UTC (rev
44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-10-01 16:50:11 UTC (rev
44184)
@@ -73,17 +73,7 @@
<action type="UNINSTALL">
<operation
class="org.jboss.tools.maven.core.libprov.MavenLibraryProviderUninstallOperation"/>
</action>
-
</provider>
-
- <provider id="maven-hibernate-library-provider"
abstract="true" extends="maven-library-provider">
- <label>%Maven_Hibernate_library_provider</label>
- <priority>500</priority>
- <action type="INSTALL">
- <config
class="org.jboss.tools.maven.core.libprov.MavenHibernateLibraryProviderInstallOperationConfig"/>
- <operation
class="org.jboss.tools.maven.core.libprov.MavenLibraryProviderInstallOperation"/>
- </action>
- </provider>
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
@@ -146,92 +136,7 @@
</enablement>
</provider>
</extension>
- <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate332-maven-library-provider"
extends="maven-hibernate-library-provider">
- <label>%Hibernate_3_3_2_Libraries</label>
- <param name="template"
value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate332-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>
- <with variable="jpaPlatform">
- <equals value="hibernate"/>
- </with>
- </and>
- </enablement>
- </provider>
- </extension>
- <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate41X-maven-library-provider"
extends="maven-hibernate-library-provider">
- <label>%Hibernate_4_1_X_Libraries</label>
- <param name="template"
value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate41X-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:2.0" forcePluginActivation="true"/>
- </with>
- </and>
- </enablement>
- </provider>
- </extension>
- <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
- <provider id="hibernate36X-maven-library-provider"
extends="maven-hibernate-library-provider">
- <label>%Hibernate_3_6_X_Libraries</label>
- <param name="template"
value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate36X-template.xml"/>
- <enablement>
- <or>
- <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:2.0" forcePluginActivation="true"/>
- </with>
- </and>
- <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>
- </or>
- </enablement>
- </provider>
- </extension>
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
- <!-- Using a noop validator to fix
https://issues.jboss.org/browse/JBIDE-11624
-->
- <libraryValidator
- id="jpaMavenLibraryValidator"
-
class="org.jboss.tools.maven.core.libprov.HibernateLibValidator">
- <enablement>
- <or>
- <with variable="libraryProvider">
- <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate41X-maven-library-provider"/>
- </with>
- <with variable="libraryProvider">
- <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate36X-maven-library-provider"/>
- </with>
- <with variable="libraryProvider">
- <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate332-maven-library-provider"/>
- </with>
- </or>
- </enablement>
- </libraryValidator>
- </extension>
-
-
-
<extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="portlet10-maven-library-provider"
extends="maven-library-provider">
<label>%Maven_Portlet_1_0_Libraries</label>
@@ -265,8 +170,6 @@
</enablement>
</provider>
</extension>
-
-
<extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="portletbridge200alpha-maven-library-provider"
extends="maven-library-provider">
<label>%Maven_Portletbridge_2_0_0_ALPHA_Libraries</label>
Deleted: trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate332-template.xml
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate332-template.xml 2012-10-01
16:13:01 UTC (rev 44183)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate332-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,101 +0,0 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>template</groupId>
- <artifactId>template</artifactId>
- <packaging>pom</packaging>
- <version>0.0.1-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.3.2.GA</version>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.4.0.GA</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>3.4.0.GA</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>3.1.0.GA</version>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search</artifactId>
- <version>3.1.1.GA</version>
- <exclusions>
- <exclusion>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Deleted: trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate36X-template.xml
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate36X-template.xml 2012-10-01
16:13:01 UTC (rev 44183)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate36X-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,116 +0,0 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>template</groupId>
- <artifactId>template</artifactId>
- <packaging>pom</packaging>
- <version>0.0.1-SNAPSHOT</version>
-
- <!-- inspired from
https://raw.github.com/jbossas/quickstart/master/hibernate3/pom.xml -->
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.6.10.Final</version>
-
- <!-- Some transitive dependencies of Hibernate 3 are available
- in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
- depend on the modules -->
- <exclusions>
- <exclusion>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Define dependency version of hibernate-entitymanager -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>3.6.10.Final</version>
- <!-- Some transitive dependencies of Hibernate 3 are available
- in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
- depend on the modules -->
- <exclusions>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Define dependency version of hibernate-validator -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>3.1.0.GA</version>
- <!-- Some transitive dependencies of Hibernate 3 are available
- in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
- depend on the modules -->
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Define dependency version of hibernate-commons-annotations -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>3.2.0.Final</version>
- <!-- Some transitive dependencies of Hibernate 3 are available
- in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
- depend on the modules -->
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search</artifactId>
- <version>4.1.0.Final</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Deleted: trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate41X-template.xml
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate41X-template.xml 2012-10-01
16:13:01 UTC (rev 44183)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/poms/hibernate41X-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,90 +0,0 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>template</groupId>
- <artifactId>template</artifactId>
- <packaging>pom</packaging>
- <version>0.0.1-SNAPSHOT</version>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.bom</groupId>
- <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
- <version>1.0.0.M7</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
-<dependencies>
- <!-- Hibernate ORM sub-modules -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <!-- this already part of JDK6 -->
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>provided</scope>
- </dependency>
- <!--
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-envers</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-c3p0</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- </dependency>
- -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search</artifactId>
- <version>4.1.0.Final</version>
- </dependency>
- <!--
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-analyzers</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-orm</artifactId>
- </dependency>
- -->
- <!-- Tools
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator-annotation-processor</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-jpamodelgen</artifactId>
- </dependency>
- -->
-</dependencies>
-</project>
\ No newline at end of file
Deleted:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java 2012-10-01
16:13:01 UTC (rev 44183)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/HibernateLibValidator.java 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,34 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2012 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.tools.maven.core.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
-import org.jboss.tools.maven.core.MavenCoreActivator;
-
-public class HibernateLibValidator implements LibraryValidator {
-
- @SuppressWarnings("nls")
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JpaLibraryProviderInstallOperationConfig jpaConfig =
(JpaLibraryProviderInstallOperationConfig) config;
- IStatus status;
- if (jpaConfig.getJpaPlatform().getId().contains("hibernate")) {
- status = Status.OK_STATUS;
- } else {
- status = new Status(IStatus.ERROR, MavenCoreActivator.PLUGIN_ID, "This JPA
implementation requires an Hibernate-based Platform");
- }
- return status;
- }
-
-}
Deleted:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java 2012-10-01
16:13:01 UTC (rev 44183)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,54 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2012 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.tools.maven.core.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-
-/**
- * @author Fred Bricon
- *
- */
-public class MavenHibernateLibraryProviderInstallOperationConfig extends
MavenLibraryProviderInstallOperationConfig implements
JpaLibraryProviderInstallOperationConfig {
-
- private JpaPlatformDescription jpaPlatformDescription;
-
- public JpaPlatformDescription getJpaPlatform() {
- return jpaPlatformDescription;
- }
-
- public void setJpaPlatform(JpaPlatformDescription jpaPlatform) {
- this.jpaPlatformDescription = jpaPlatform;
- }
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
- if (getJpaPlatform() != null) {
- for (LibraryValidator libraryValidator :
JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
- }
-
- return Status.OK_STATUS;
- }
-
-}
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF 2012-10-01
16:13:01 UTC (rev 44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF 2012-10-01
16:50:11 UTC (rev 44184)
@@ -12,6 +12,8 @@
org.eclipse.jst.j2ee.core,
org.eclipse.jst.j2ee,
org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.jpt.jpa.core,
org.hibernate.eclipse.console
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.properties 2012-10-01
16:13:01 UTC (rev 44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.properties 2012-10-01
16:50:11 UTC (rev 44184)
@@ -1,4 +1,8 @@
Bundle-Vendor = JBoss by Red Hat
Bundle-Name = JBoss Maven Hibernate Configurator
Hibernate_Project_configurator = Hibernate
+Maven_Hibernate_library_provider=Maven Hibernate library provider
+Hibernate_3_3_2_Libraries=Hibernate 3.3.2 Libraries
+Hibernate_3_6_X_Libraries=Hibernate 3.6.10 Libraries
+Hibernate_4_1_X_Libraries=Hibernate 4.1.1 Libraries
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.xml 2012-10-01 16:13:01 UTC
(rev 44183)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/plugin.xml 2012-10-01 16:50:11 UTC
(rev 44184)
@@ -22,5 +22,101 @@
name="%Hibernate_Project_configurator"
secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"/>
</extension>
-
+
+ <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+ <provider id="maven-hibernate-library-provider"
abstract="true" extends="maven-library-provider">
+ <label>%Maven_Hibernate_library_provider</label>
+ <priority>500</priority>
+ <action type="INSTALL">
+ <config
class="org.jboss.tools.maven.hibernate.libprov.MavenHibernateLibraryProviderInstallOperationConfig"/>
+ <operation
class="org.jboss.tools.maven.core.libprov.MavenLibraryProviderInstallOperation"/>
+ </action>
+ </provider>
+ </extension>
+
+ <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+ <provider id="hibernate332-maven-library-provider"
extends="maven-hibernate-library-provider">
+ <label>%Hibernate_3_3_2_Libraries</label>
+ <param name="template"
value="platform:/plugin/org.jboss.tools.maven.hibernate/poms/hibernate332-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>
+ <with variable="jpaPlatform">
+ <equals value="hibernate"/>
+ </with>
+ </and>
+ </enablement>
+ </provider>
+ </extension>
+ <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+ <provider id="hibernate41X-maven-library-provider"
extends="maven-hibernate-library-provider">
+ <label>%Hibernate_4_1_X_Libraries</label>
+ <param name="template"
value="platform:/plugin/org.jboss.tools.maven.hibernate/poms/hibernate41X-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:2.0" forcePluginActivation="true"/>
+ </with>
+ </and>
+ </enablement>
+ </provider>
+ </extension>
+ <extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+ <provider id="hibernate36X-maven-library-provider"
extends="maven-hibernate-library-provider">
+ <label>%Hibernate_3_6_X_Libraries</label>
+ <param name="template"
value="platform:/plugin/org.jboss.tools.maven.hibernate/poms/hibernate36X-template.xml"/>
+ <enablement>
+ <or>
+ <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:2.0" forcePluginActivation="true"/>
+ </with>
+ </and>
+ <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>
+ </or>
+ </enablement>
+ </provider>
+ </extension>
+
+ <extension
+ point="org.eclipse.jpt.common.core.libraryValidators">
+ <!-- Using a noop validator to fix
https://issues.jboss.org/browse/JBIDE-11624
-->
+ <libraryValidator
+ id="jpaMavenLibraryValidator"
+
class="org.jboss.tools.maven.hibernate.libprov.HibernateLibValidator">
+ <enablement>
+ <or>
+ <with variable="libraryProvider">
+ <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate41X-maven-library-provider"/>
+ </with>
+ <with variable="libraryProvider">
+ <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate36X-maven-library-provider"/>
+ </with>
+ <with variable="libraryProvider">
+ <test
property="org.eclipse.jpt.common.core.extendsId"
value="hibernate332-maven-library-provider"/>
+ </with>
+ </or>
+ </enablement>
+ </libraryValidator>
+ </extension>
+
+
</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate332-template.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate332-template.xml
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate332-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -0,0 +1,101 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>template</groupId>
+ <artifactId>template</artifactId>
+ <packaging>pom</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.2.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.4.0.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.4.0.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.1.0.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>3.1.1.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate36X-template.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate36X-template.xml
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate36X-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -0,0 +1,116 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>template</groupId>
+ <artifactId>template</artifactId>
+ <packaging>pom</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <!-- inspired from
https://raw.github.com/jbossas/quickstart/master/hibernate3/pom.xml -->
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.6.10.Final</version>
+
+ <!-- Some transitive dependencies of Hibernate 3 are available
+ in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
+ depend on the modules -->
+ <exclusions>
+ <exclusion>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Define dependency version of hibernate-entitymanager -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.6.10.Final</version>
+ <!-- Some transitive dependencies of Hibernate 3 are available
+ in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
+ depend on the modules -->
+ <exclusions>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Define dependency version of hibernate-validator -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.1.0.GA</version>
+ <!-- Some transitive dependencies of Hibernate 3 are available
+ in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
+ depend on the modules -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Define dependency version of hibernate-commons-annotations -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-commons-annotations</artifactId>
+ <version>3.2.0.Final</version>
+ <!-- Some transitive dependencies of Hibernate 3 are available
+ in JBoss AS 7 as modules, so we don't include them in
WEB-INF/lib, but instead
+ depend on the modules -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>4.1.0.Final</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate41X-template.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate41X-template.xml
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.hibernate/poms/hibernate41X-template.xml 2012-10-01
16:50:11 UTC (rev 44184)
@@ -0,0 +1,89 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>template</groupId>
+ <artifactId>template</artifactId>
+ <packaging>pom</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.bom</groupId>
+ <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
+ <version>1.0.1.Final</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+<dependencies>
+ <!-- Hibernate ORM sub-modules -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <!-- this already part of JDK6 -->
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-envers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-c3p0</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-ehcache</artifactId>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-analyzers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-orm</artifactId>
+ </dependency>
+ -->
+ <!-- Tools
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator-annotation-processor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-jpamodelgen</artifactId>
+ </dependency>
+ -->
+</dependencies>
+</project>
\ No newline at end of file
Added:
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/HibernateLibValidator.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/HibernateLibValidator.java
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/HibernateLibValidator.java 2012-10-01
16:50:11 UTC (rev 44184)
@@ -0,0 +1,34 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.hibernate.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
+import org.eclipse.jpt.common.core.libval.LibraryValidator;
+import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
+import org.jboss.tools.maven.core.MavenCoreActivator;
+
+public class HibernateLibValidator implements LibraryValidator {
+
+ @SuppressWarnings("nls")
+ public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
+ JpaLibraryProviderInstallOperationConfig jpaConfig =
(JpaLibraryProviderInstallOperationConfig) config;
+ IStatus status;
+ if (jpaConfig.getJpaPlatform().getId().contains("hibernate")) {
+ status = Status.OK_STATUS;
+ } else {
+ status = new Status(IStatus.ERROR, MavenCoreActivator.PLUGIN_ID, "This JPA
implementation requires an Hibernate-based Platform");
+ }
+ return status;
+ }
+
+}
Added:
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/libprov/MavenHibernateLibraryProviderInstallOperationConfig.java 2012-10-01
16:50:11 UTC (rev 44184)
@@ -0,0 +1,55 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.hibernate.libprov;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.core.libval.LibraryValidator;
+import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
+import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
+import org.jboss.tools.maven.core.libprov.MavenLibraryProviderInstallOperationConfig;
+
+/**
+ * @author Fred Bricon
+ *
+ */
+public class MavenHibernateLibraryProviderInstallOperationConfig extends
MavenLibraryProviderInstallOperationConfig implements
JpaLibraryProviderInstallOperationConfig {
+
+ private JpaPlatformDescription jpaPlatformDescription;
+
+ public JpaPlatformDescription getJpaPlatform() {
+ return jpaPlatformDescription;
+ }
+
+ public void setJpaPlatform(JpaPlatformDescription jpaPlatform) {
+ this.jpaPlatformDescription = jpaPlatform;
+ }
+
+ @Override
+ public synchronized IStatus validate() {
+ IStatus status = super.validate();
+ if (! status.isOK()) {
+ return status;
+ }
+ if (getJpaPlatform() != null) {
+ for (LibraryValidator libraryValidator :
JptCommonCorePlugin.getLibraryValidators(this)) {
+ status = libraryValidator.validate(this);
+ if (! status.isOK()) {
+ return status;
+ }
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+
+}