Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 3.6.10依赖项解析_Hibernate_Ivy_Slf4j - Fatal编程技术网

Hibernate 3.6.10依赖项解析

Hibernate 3.6.10依赖项解析,hibernate,ivy,slf4j,Hibernate,Ivy,Slf4j,我最近升级了一个项目,使用hibernate 3.6.10.Final。该项目使用ivy来检索和分析依赖项。现在我得到一个错误,在slf4j中找不到方法。我认为这是由于hibernate core(需要1.6.1)和hibernate commons注释(需要1.5.8)之间存在冲突的slf4j依赖关系。根据hibernate core ivy.xml,hibernate core依赖于hibernate commons注释 这就是我得到的错误: Constructor threw excep

我最近升级了一个项目,使用hibernate 3.6.10.Final。该项目使用ivy来检索和分析依赖项。现在我得到一个错误,在slf4j中找不到方法。我认为这是由于hibernate core(需要1.6.1)和hibernate commons注释(需要1.5.8)之间存在冲突的slf4j依赖关系。根据hibernate core ivy.xml,hibernate core依赖于hibernate commons注释

这就是我得到的错误:

 Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;:
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
        at org.slf4j.impl.JDK14LoggerAdapter.info(JDK14LoggerAdapter.java:303)
        at org.hibernate.annotations.common.Version.<clinit>(Version.java:37)
        at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.<clinit>(JavaReflectionManager.java:73)
        at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2988)
        at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2984)
        at org.hibernate.cfg.Configuration.reset(Configuration.java:307)
        at org.hibernate.cfg.Configuration.<init>(Configuration.java:298)
        at org.hibernate.cfg.Configuration.<init>(Configuration.java:302)
        at mb.common.hibernate.cfg.DefaultEnhancedConfiguration.<init>(DefaultEnhancedConfiguration.java:10)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
构造函数抛出异常;嵌套的异常是java.lang.NoSuchMethodError:org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;:
java.lang.NoSuchMethodError:org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
位于org.slf4j.impl.JDK14LoggerAdapter.info(JDK14LoggerAdapter.java:303)
位于org.hibernate.annotations.common.Version(Version.java:37)
位于org.hibernate.annotations.common.reflection.java.JavaReflectionManager(JavaReflectionManager.java:73)
位于org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2988)
位于org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2984)
位于org.hibernate.cfg.Configuration.reset(Configuration.java:307)
位于org.hibernate.cfg.Configuration(Configuration.java:298)
位于org.hibernate.cfg.Configuration(Configuration.java:302)
位于mb.common.hibernate.cfg.DefaultEnhancedConfiguration。(DefaultEnhancedConfiguration.java:10)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
位于java.lang.reflect.Constructor.newInstance(Constructor.java:525)
我检查了旧的slf4j javadoc,可以肯定的是,slf4j-1.6.1有一个format方法,它返回一个FomattingTuple,而不是一个字符串

以下是从maven2存储库检索到的hibernate-core-3.6.10.Final ivy.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="org.hibernate"
        module="hibernate-core"
        revision="3.6.10.Final"
        status="release"
        publication="20120208201903"
    >
        <description homepage="">
        The core functionality of Hibernate
        </description>
        <m:dependency.management__javassist__javassist__version>3.12.0.GA</m:dependency.management__javassist__javassist__version>
        <m:properties__bytemanVersion>1.5.1</m:properties__bytemanVersion>
        <m:dependency.management__commons-collections__commons-collections__version>3.1</m:dependency.management__commons-collections__commons-collections__version>
        <m:dependency.management__javax.validation__validation-api__version>1.0.0.GA</m:dependency.management__javax.validation__validation-api__version>
        <m:dependency.management__dom4j__dom4j__version>1.6.1</m:dependency.management__dom4j__dom4j__version>
        <m:dependency.management__org.hibernate__hibernate-validator__version>4.1.0.Final</m:dependency.management__org.hibernate__hibernate-validator__version>
        <m:dependency.management__cglib__cglib__version>2.2</m:dependency.management__cglib__cglib__version>
        <m:dependency.management__org.hibernate.javax.persistence__hibernate-jpa-2.0-api__version>1.0.1.Final</m:dependency.management__org.hibernate.javax.persistence__hibernate-jpa-2.0-api__version>
        <m:dependency.management__com.h2database__h2__version>1.2.145</m:dependency.management__com.h2database__h2__version>
        <m:properties__project.build.sourceEncoding>UTF-8</m:properties__project.build.sourceEncoding>
        <m:properties__slf4jVersion>1.6.1</m:properties__slf4jVersion>
        <m:dependency.management__org.slf4j__slf4j-api__version>1.6.1</m:dependency.management__org.slf4j__slf4j-api__version>
        <m:dependency.management__antlr__antlr__version>2.7.6</m:dependency.management__antlr__antlr__version>
        <m:dependency.management__org.hibernate__hibernate-commons-annotations__version>3.2.0.Final</m:dependency.management__org.hibernate__hibernate-commons-annotations__version>
        <m:properties__antlrPluginVersion>2.1</m:properties__antlrPluginVersion>
        <m:dependency.management__org.jboss.byteman__byteman__version>1.5.1</m:dependency.management__org.jboss.byteman__byteman__version>
        <m:maven.plugins>org.jboss.maven.plugins__maven-jdocbook-style-plugin__null|org.codehaus.groovy.maven__gmaven-plugin__1.0|org.apache.maven.plugins__maven-enforcer-plugin__null|org.apache.maven.plugins__maven-compiler-plugin__null|org.apache.maven.plugins__maven-jar-plugin__null|org.apache.maven.plugins__maven-surefire-plugin__null|org.apache.maven.plugins__maven-source-plugin__null|org.jboss.maven.plugins__maven-jdocbook-style-plugin__null|org.codehaus.groovy.maven__gmaven-plugin__1.0|org.apache.maven.plugins__maven-enforcer-plugin__null|org.apache.maven.plugins__maven-compiler-plugin__null|org.apache.maven.plugins__maven-jar-plugin__null|org.apache.maven.plugins__maven-surefire-plugin__null|org.apache.maven.plugins__maven-source-plugin__null|org.codehaus.mojo__antlr-maven-plugin__2.1|org.jboss.maven.plugins__maven-injection-plugin__null|null__maven-jar-plugin__null</m:maven.plugins>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="hibernate-core" type="jar" ext="jar" conf="master"/>
        <artifact name="hibernate-core" type="source" ext="jar" conf="sources" m:classifier="sources"/>
    </publications>
    <dependencies>
        <dependency org="antlr" name="antlr" rev="2.7.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="commons-collections" name="commons-collections" rev="3.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="dom4j" name="dom4j" rev="1.6.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
            <exclude org="xml-apis" module="xml-apis" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.2.0.Final" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.1.Final" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/>
        <dependency org="org.hibernate" name="hibernate-validator" rev="4.1.0.Final" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="javax.xml.bind" name="jaxb-api" rev="2.2" force="true" conf="test->runtime(*),master(*)">
            <exclude org="javax.xml.stream" module="stax-api" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="javax.activation" module="activation" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="com.sun.xml.bind" name="jaxb-impl" rev="2.1.12" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="javassist" name="javassist" rev="3.12.0.GA" force="true" conf="optional->compile(*),master(*)"/>
        <dependency org="cglib" name="cglib" rev="2.2" force="true" conf="optional->compile(*),master(*)"/>
        <dependency org="javax.transaction" name="jta" rev="1.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="org.jboss.javaee" name="jboss-jacc-api_JDK4" rev="1.1.0" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)">
            <exclude org="org.jboss.javaee" module="jboss-servlet-api_3.0" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="org.jboss.logging" module="jboss-logging-spi" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="org.jboss" module="jboss-common-core" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="ant" name="ant" rev="1.6.5" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/>
        <dependency org="com.h2database" name="h2" rev="1.2.145" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging-api" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <override org="commons-collections" module="commons-collections" matcher="exact" rev="3.1"/>
        <override org="org.hibernate" module="hibernate-validator" matcher="exact" rev="4.1.0.Final"/>
        <override org="javassist" module="javassist" matcher="exact" rev="3.12.0.GA"/>
        <override org="org.jboss.byteman" module="byteman" matcher="exact" rev="1.5.1"/>
        <override org="cglib" module="cglib" matcher="exact" rev="2.2"/>
        <override org="org.hibernate.javax.persistence" module="hibernate-jpa-2.0-api" matcher="exact" rev="1.0.1.Final"/>
        <override org="com.h2database" module="h2" matcher="exact" rev="1.2.145"/>
        <override org="org.hibernate" module="hibernate-commons-annotations" matcher="exact" rev="3.2.0.Final"/>
        <override org="org.slf4j" module="slf4j-api" matcher="exact" rev="1.6.1"/>
        <override org="antlr" module="antlr" matcher="exact" rev="2.7.6"/>
        <override org="javax.validation" module="validation-api" matcher="exact" rev="1.0.0.GA"/>
        <override org="dom4j" module="dom4j" matcher="exact" rev="1.6.1"/>
    </dependencies>
</ivy-module>
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="org.hibernate"
        module="hibernate-commons-annotations"
        revision="3.2.0.Final"
        status="release"
        publication="20100309114153"
    >
        <license name="GNU LESSER GENERAL PUBLIC LICENSE" url="http://www.gnu.org/licenses/lgpl.txt" />
        <description homepage="http://hibernate.org">
        Common reflection code used in support of annotation processing
        </description>
        <m:dependency.management__org.slf4j__slf4j-api__version>1.5.8</m:dependency.management__org.slf4j__slf4j-api__version>
        <m:properties__slf4jVersion>1.5.8</m:properties__slf4jVersion>
        <m:maven.plugins>org.apache.maven.plugins__maven-compiler-plugin__null</m:maven.plugins>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="hibernate-commons-annotations" type="jar" ext="jar" conf="master"/>
        <artifact name="hibernate-commons-annotations" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="hibernate-commons-annotations" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
    </publications>
    <dependencies>
        <dependency org="org.slf4j" name="slf4j-api" rev="1.5.8" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.5.8" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.5.8" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging-api" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <override org="org.slf4j" module="slf4j-api" matcher="exact" rev="1.5.8"/>
    </dependencies>
</ivy-module>

Hibernate的核心功能
3.12.0.GA
1.5.1
3.1
1.0.0.GA
1.6.1
4.1.0.1最终版本
2.2
1.0.1.最终版本
1.2.145
UTF-8
1.6.1
1.6.1
2.7.6
3.2.0.1最终版本
2.1
1.5.1
10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.10.4.7.4.4.4.4.10.10.10.10.10.10.10.10.10.10.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.组织组织组织网站网站运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营运营商的路路路路路路途中途中途中途中途中途中的网站网站网站网站网站网站网站网站网站网站网站的路路路路路路路途中途中途中途中途中途中途中途中的官官官官官官官官官官官官官官官官官官官官官官官官官兵兵兵的网站网站网站网站网站网站网站网站网站网站网站网站网站网站网站网站网站网站的_maven-s(UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUnull(((无无无无值值值值值值值值值值值值值))))的网站网站网站网站——据据据据据据据据据据据据据据据据据据据据据据据;org.apache.mav插件maven-source-plugin-plugin-nunull | org.codehaus.mojo_u-antlr-maven-plugin | org.jboss.maven.plugins_u-maven-injection-plugin | null | maven-jar-plugin | null
以下是从maven2存储库检索到的hibernate-commons-annotations-3.2.0.Final ivy.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="org.hibernate"
        module="hibernate-core"
        revision="3.6.10.Final"
        status="release"
        publication="20120208201903"
    >
        <description homepage="">
        The core functionality of Hibernate
        </description>
        <m:dependency.management__javassist__javassist__version>3.12.0.GA</m:dependency.management__javassist__javassist__version>
        <m:properties__bytemanVersion>1.5.1</m:properties__bytemanVersion>
        <m:dependency.management__commons-collections__commons-collections__version>3.1</m:dependency.management__commons-collections__commons-collections__version>
        <m:dependency.management__javax.validation__validation-api__version>1.0.0.GA</m:dependency.management__javax.validation__validation-api__version>
        <m:dependency.management__dom4j__dom4j__version>1.6.1</m:dependency.management__dom4j__dom4j__version>
        <m:dependency.management__org.hibernate__hibernate-validator__version>4.1.0.Final</m:dependency.management__org.hibernate__hibernate-validator__version>
        <m:dependency.management__cglib__cglib__version>2.2</m:dependency.management__cglib__cglib__version>
        <m:dependency.management__org.hibernate.javax.persistence__hibernate-jpa-2.0-api__version>1.0.1.Final</m:dependency.management__org.hibernate.javax.persistence__hibernate-jpa-2.0-api__version>
        <m:dependency.management__com.h2database__h2__version>1.2.145</m:dependency.management__com.h2database__h2__version>
        <m:properties__project.build.sourceEncoding>UTF-8</m:properties__project.build.sourceEncoding>
        <m:properties__slf4jVersion>1.6.1</m:properties__slf4jVersion>
        <m:dependency.management__org.slf4j__slf4j-api__version>1.6.1</m:dependency.management__org.slf4j__slf4j-api__version>
        <m:dependency.management__antlr__antlr__version>2.7.6</m:dependency.management__antlr__antlr__version>
        <m:dependency.management__org.hibernate__hibernate-commons-annotations__version>3.2.0.Final</m:dependency.management__org.hibernate__hibernate-commons-annotations__version>
        <m:properties__antlrPluginVersion>2.1</m:properties__antlrPluginVersion>
        <m:dependency.management__org.jboss.byteman__byteman__version>1.5.1</m:dependency.management__org.jboss.byteman__byteman__version>
        <m:maven.plugins>org.jboss.maven.plugins__maven-jdocbook-style-plugin__null|org.codehaus.groovy.maven__gmaven-plugin__1.0|org.apache.maven.plugins__maven-enforcer-plugin__null|org.apache.maven.plugins__maven-compiler-plugin__null|org.apache.maven.plugins__maven-jar-plugin__null|org.apache.maven.plugins__maven-surefire-plugin__null|org.apache.maven.plugins__maven-source-plugin__null|org.jboss.maven.plugins__maven-jdocbook-style-plugin__null|org.codehaus.groovy.maven__gmaven-plugin__1.0|org.apache.maven.plugins__maven-enforcer-plugin__null|org.apache.maven.plugins__maven-compiler-plugin__null|org.apache.maven.plugins__maven-jar-plugin__null|org.apache.maven.plugins__maven-surefire-plugin__null|org.apache.maven.plugins__maven-source-plugin__null|org.codehaus.mojo__antlr-maven-plugin__2.1|org.jboss.maven.plugins__maven-injection-plugin__null|null__maven-jar-plugin__null</m:maven.plugins>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="hibernate-core" type="jar" ext="jar" conf="master"/>
        <artifact name="hibernate-core" type="source" ext="jar" conf="sources" m:classifier="sources"/>
    </publications>
    <dependencies>
        <dependency org="antlr" name="antlr" rev="2.7.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="commons-collections" name="commons-collections" rev="3.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="dom4j" name="dom4j" rev="1.6.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
            <exclude org="xml-apis" module="xml-apis" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.2.0.Final" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.1.Final" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/>
        <dependency org="org.hibernate" name="hibernate-validator" rev="4.1.0.Final" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="javax.xml.bind" name="jaxb-api" rev="2.2" force="true" conf="test->runtime(*),master(*)">
            <exclude org="javax.xml.stream" module="stax-api" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="javax.activation" module="activation" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="com.sun.xml.bind" name="jaxb-impl" rev="2.1.12" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="javassist" name="javassist" rev="3.12.0.GA" force="true" conf="optional->compile(*),master(*)"/>
        <dependency org="cglib" name="cglib" rev="2.2" force="true" conf="optional->compile(*),master(*)"/>
        <dependency org="javax.transaction" name="jta" rev="1.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="org.jboss.javaee" name="jboss-jacc-api_JDK4" rev="1.1.0" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)">
            <exclude org="org.jboss.javaee" module="jboss-servlet-api_3.0" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="org.jboss.logging" module="jboss-logging-spi" name="*" type="*" ext="*" conf="" matcher="exact"/>
            <exclude org="org.jboss" module="jboss-common-core" name="*" type="*" ext="*" conf="" matcher="exact"/>
        </dependency>
        <dependency org="ant" name="ant" rev="1.6.5" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/>
        <dependency org="com.h2database" name="h2" rev="1.2.145" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging-api" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <override org="commons-collections" module="commons-collections" matcher="exact" rev="3.1"/>
        <override org="org.hibernate" module="hibernate-validator" matcher="exact" rev="4.1.0.Final"/>
        <override org="javassist" module="javassist" matcher="exact" rev="3.12.0.GA"/>
        <override org="org.jboss.byteman" module="byteman" matcher="exact" rev="1.5.1"/>
        <override org="cglib" module="cglib" matcher="exact" rev="2.2"/>
        <override org="org.hibernate.javax.persistence" module="hibernate-jpa-2.0-api" matcher="exact" rev="1.0.1.Final"/>
        <override org="com.h2database" module="h2" matcher="exact" rev="1.2.145"/>
        <override org="org.hibernate" module="hibernate-commons-annotations" matcher="exact" rev="3.2.0.Final"/>
        <override org="org.slf4j" module="slf4j-api" matcher="exact" rev="1.6.1"/>
        <override org="antlr" module="antlr" matcher="exact" rev="2.7.6"/>
        <override org="javax.validation" module="validation-api" matcher="exact" rev="1.0.0.GA"/>
        <override org="dom4j" module="dom4j" matcher="exact" rev="1.6.1"/>
    </dependencies>
</ivy-module>
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="org.hibernate"
        module="hibernate-commons-annotations"
        revision="3.2.0.Final"
        status="release"
        publication="20100309114153"
    >
        <license name="GNU LESSER GENERAL PUBLIC LICENSE" url="http://www.gnu.org/licenses/lgpl.txt" />
        <description homepage="http://hibernate.org">
        Common reflection code used in support of annotation processing
        </description>
        <m:dependency.management__org.slf4j__slf4j-api__version>1.5.8</m:dependency.management__org.slf4j__slf4j-api__version>
        <m:properties__slf4jVersion>1.5.8</m:properties__slf4jVersion>
        <m:maven.plugins>org.apache.maven.plugins__maven-compiler-plugin__null</m:maven.plugins>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="hibernate-commons-annotations" type="jar" ext="jar" conf="master"/>
        <artifact name="hibernate-commons-annotations" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="hibernate-commons-annotations" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
    </publications>
    <dependencies>
        <dependency org="org.slf4j" name="slf4j-api" rev="1.5.8" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.5.8" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.5.8" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="commons-logging" name="commons-logging-api" rev="99.0-does-not-exist" force="true" conf="test->runtime(*),master(*)"/>
        <override org="org.slf4j" module="slf4j-api" matcher="exact" rev="1.5.8"/>
    </dependencies>
</ivy-module>

用于支持注释处理的公共反射代码
1.5.8
1.5.8
org.apache.maven.plugins\u_maven-compiler-plugin\u_null

我该如何解决这个依赖冲突呢?

您的问题是在类路径上只能使用slf4j jar的一个副本,所以您需要决定保留哪一个副本。选择旧版本可能会修复一个编译错误,但会导致另一个错误:-)

默认情况下,ivy会选择最新的一个,前提是它会向后兼容。您可以使用以下指示器来覆盖此行为:

<dependencies>
    <dependency org="org.hibernate" name="hibernate-core" rev="3.6.10.Final" conf="compile->default"/>
    <dependency org="org.slf4j" name="slf4j-api" rev="1.5.8" conf="compile->default"/>

    <conflict org="org.slf4j" module="slf4j-api" rev="1.5.8"/>
</dependencies>

谢谢你,马克。我最终使用了一个旧版本的hibernate,在那里我不再遇到冲突。主要问题是slf4j的不同版本之间存在一些API更改,这些更改破坏了我的构建。