在WildFly 8.2.0中排除容器提供的休眠

时间:2016-01-12 00:08:02

标签: java hibernate wildfly wildfly-8

默认情况下,WildFly 8.2.0最终带有hibernate 4.3.7 final,我想在容器中使用不同版本的hibernate而不是提供的版本。我修改了threading如下。

jboss-deployment-structure

修改我的<jboss-deployment-structure> <deployment> <exclusions> <module name="org.slf4j" /> <module name="org.slf4j.impl" /> <module name="org.hibernate" slot="main"/> </exclusions> <dependencies> <module name="org.antlr"/> </dependencies> </deployment> </jboss-deployment-structure> 如下,

pom

但是,当我尝试部署时,出现以下错误。如何排除WildFly提供的hibernate并使用我的应用程序中捆绑的那个?

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <hibernate.version>4.3.11.Final</hibernate.version>        
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.version}</version>            
    </dependency>
    <!-- L2 hibernate cache -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>${hibernate.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <version>1.0.0.Final</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>            
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>5.1.3.Final</version>            
    </dependency>
</dependencies>

0 个答案:

没有答案