标签:
本文主要介绍,如何在jboss EAP6.2中使用eclipselink
下载完成以后解压,并使用maven编译,解压后的文件:
查看其中的pom.xml文件:
其中properties结点中加入自己想使用的eclipselink版本,并修改 eclipselink.version为自己定义的版本:
如原文件:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<eclipselink.version.2.3.stable>2.3.2</eclipselink.version.2.3.stable>
<eclipselink.version.2.3.milestone>2.3.3-M3</eclipselink.version.2.3.milestone>
<eclipselink.version.2.4.milestone>2.4.0</eclipselink.version.2.4.milestone>
<eclipselink.version>${eclipselink.version.2.4.milestone}</eclipselink.version>
<jboss-version>7.1.1.Final</jboss-version>
<as7module.srcdir>${project.basedir}/src/main/as7module</as7module.srcdir>
<as7module.destdir>${project.build.directory}/as7module</as7module.destdir>
<ECLIPSELINK_JAR_NAME>eclipselink-${eclipselink.version}.jar</ECLIPSELINK_JAR_NAME>
<INTEGRATION_JAR_NAME>${project.artifactId}-${project.version}.${project.packaging}</INTEGRATION_JAR_NAME>
</properties>
修改后:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<eclipselink.version.2.3.stable>2.3.2</eclipselink.version.2.3.stable>
<eclipselink.version.2.3.milestone>2.3.3-M3</eclipselink.version.2.3.milestone>
<eclipselink.version.2.4.milestone>2.4.0</eclipselink.version.2.4.milestone>
<eclipselink.version.2.6.milestone>2.6.0</eclipselink.version.2.6.milestone>
<eclipselink.version>${eclipselink.version.2.6.milestone}</eclipselink.version>
<jboss-version>7.1.1.Final</jboss-version>
<as7module.srcdir>${project.basedir}/src/main/as7module</as7module.srcdir>
<as7module.destdir>${project.build.directory}/as7module</as7module.destdir>
<ECLIPSELINK_JAR_NAME>eclipselink-${eclipselink.version}.jar</ECLIPSELINK_JAR_NAME>
<INTEGRATION_JAR_NAME>${project.artifactId}-${project.version}.${project.packaging}</INTEGRATION_JAR_NAME>
</properties>
mvn -DskipTests clean install
运行完以后生成target目录如下:
拷贝target/as7module目录下id和org两个文件夹到$JBOSS_HOME/modules/system/layers/base目录下(如果已经存在org目录,就合并)
启动jboss,执行
$JBOSS_HOME/bin/jboss-cli.bat --connect
/system-property=eclipselink.archive.factory:add(value=id.au.ringerc.as7.eclipselinkintegration.JBossArchiveFactoryImpl)
<system-properties>
<property name="eclipselink.archive.factory" value="id.au.ringerc.as7.eclipselinkintegration.JBossArchiveFactoryImpl"/>
</system-properties>
/system-property=eclipselink.target-server:add(value=JBoss)
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<property name="eclipselink.target-server" value="JBoss"/>
<class>mtsample.hotel.model.RentHistory</class>
<class>mtsample.hotel.model.HotelGuest</class>
<class>mtsample.hotel.model.Tenant</class>
<class>mtsample.hotel.model.Room</class>
<class>mtsample.hotel.model.Category</class>
<class>mtsample.hotel.model.HotelAdmin</class>
……
<build>
<plugins>
<plugin>
<groupId>au.com.alderaan</groupId>
<artifactId>eclipselink-staticweave-maven-plugin</artifactId>
<version>1.0.3</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>weave</goal>
</goals>
<configuration>
<persistenceXMLLocation>META-INF/persistence.xml</persistenceXMLLocation>
<logLevel>FINE</logLevel>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.6.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<property name="eclipselink.weaving" value="static"/>
https://developer.jboss.org/wiki/HowToUseEclipseLinkWithAS7?_sscc=t
版权声明:本文为博主原创文章,未经博主允许不得转载。
跟我上“云”端(三)eclipselink+jboss实现多租户基本配置
标签:
原文地址:http://blog.csdn.net/hy6688_/article/details/47171563