我使用 Spring & Hibernate 和 maven 作为工具组织者制作了一个项目。
有时,似乎以下版本的休眠已从所有存储库中停止/删除/某些东西
        <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-annotations</artifactId>
        <version>3.3.0.ga</version>
        <exclusions>
            <exclusion>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
     <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-commons-annotations
        </artifactId>
        <version>3.3.0.ga</version>
    </dependency>
所以,我切换到以下版本来解决所有与编译相关的问题等:
       <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-annotations</artifactId>
        <!--version>3.3.0.ga</version-->
        <version>3.5.6-Final</version>
        <exclusions>
            <exclusion>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-commons-annotations
        </artifactId>
        <version>3.3.0.ga</version>
        <!--version>3.5.6-Final</version-->
    </dependency>
虽然所有与编译相关的问题都得到了解决,但我在尝试部署使用这些休眠版本和 spring 依赖项创建的 war 文件时遇到了很多问题(尽管 war 已成功生成,而部署 Spring 和 hibernate 给出了一些错误)。
基本上,我想使用最新版本的 Spring & Hibernate 并创建一个 web 应用程序 war 文件。
如果有人可以列出在所有存储库中成功可用的一组 spring 和 hibernate maven 依赖项以及创建成功的 Web 应用程序的存储库列表,我将非常感激,最好是如果您已成功部署并使用了那场战争。
这些是我在我的应用程序中使用的与 spring 相关的依赖项和其他依赖项:
  <properties>
    <servlet-api.version>2.5.0</servlet-api.version>
    <maven.jetty.version>6.1.10</maven.jetty.version>
    <!--ehcache.version>1.2.3</ehcache.version-->
    <net.sf.ehcache.version>2.2.0</net.sf.ehcache.version>
</properties>
<build>
    <finalName>in</finalName>
    <plugins>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>${maven.jetty.version}</version>
        </plugin>
        <plugin>
            <groupId>org.codehaus.enunciate</groupId>
            <artifactId>maven-enunciate-plugin
            </artifactId>
            <version>${enunciate.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>assemble</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.terracotta.maven.plugins</groupId>
            <artifactId>tc-maven-plugin</artifactId>
            <version>1.5.1</version>
            <executions>
                <execution>
                    <id>run-integration</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>run-integration</goal>
                    </goals>
                </execution>
                <execution>
                    <id>terminate-integration</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>terminate-integration</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<dependencies>
    <!--
          dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId>
          <version>1.2.12</version> </dependency
      -->
    <dependency>
        <groupId>com.googlecode.json-simple
        </groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <!--
          test temp dependency> <groupId>org.springframework</groupId>
          <artifactId>org.springframework.core </artifactId>
          <version>${spring.version}</version> </dependency
      -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.servlet
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.beans
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.oxm
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>com.springsource.javax.servlet
        </artifactId>
        <version>${servlet-api.version}</version>
        <scope>provided</scope>
    </dependency>
    <!--
          test temp dependency> <groupId>com.google.collections</groupId>
          <artifactId>google-collections</artifactId>
          <version>1.0-rc4</version> </dependency
      -->
    <!--
          test temp dependency> <groupId>org.opensymphony.quartz</groupId>
          <artifactId>quartz</artifactId> <version>1.6.1</version> </dependency
      -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context.support
        </artifactId>
        <version>${spring.version}</version>
    </dependency>
    <!--
          test temp dependency> <groupId>org.springframework</groupId>
          <artifactId>org.springframework.transaction </artifactId>
          <version>${spring.version}</version> </dependency
      -->
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.1</version>
    </dependency>
    <dependency>
        <groupId>velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.5</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
    </dependency>
    <!--
          dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId>
          <version>1.2.14</version> </dependency
      -->
    <dependency>
        <groupId>org.codehaus.enunciate</groupId>
        <artifactId>enunciate-rt</artifactId>
        <version>${enunciate.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>enunciate-xfire</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>enunciate-xfire-rt</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>enunciate-gwt-rt</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>enunciate-amf-rt</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>enunciate-rest-rt</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>spring-webmvc</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
                <artifactId>enunciate-jaxws-ri-rt</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
                <artifactId>enunciate-jersey-rt</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <!--
          temp testdependency> <groupId>org.codehaus.enunciate</groupId>
          <artifactId>enunciate-jaxws-ri-rt</artifactId>
          <version>${enunciate.version}</version> <exclusions> <exclusion>
          <artifactId>spring-web</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-context</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-core</artifactId>
          <groupId>org.springframework</groupId> </exclusion> </exclusions>
          </dependency
      -->
    <!--
          temp test dependency> <groupId>org.codehaus.enunciate</groupId>
          <artifactId>enunciate-jersey-rt</artifactId>
          <version>${enunciate.version}</version> <exclusions> <exclusion>
          <artifactId>spring-web</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-aop</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-beans</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-context</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-core</artifactId>
          <groupId>org.springframework</groupId> </exclusion> </exclusions>
          </dependency
      -->
    <!--
          temp test dependency> <groupId>org.codehaus.enunciate</groupId>
          <artifactId>enunciate-spring-app-rt </artifactId>
          <version>${enunciate.version}</version> <exclusions> <exclusion>
          <artifactId>spring-webmvc</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-beans</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-web</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-aop</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-context</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-core</artifactId>
          <groupId>org.springframework</groupId> </exclusion> </exclusions>
          </dependency
      -->
    <!--
          temp test dependency> <groupId>org.codehaus.enunciate</groupId>
          <artifactId>enunciate-rest-rt</artifactId>
          <version>${enunciate.version}</version> <exclusions> <exclusion>
          <artifactId>spring-beans</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-context</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-web</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>spring-webmvc</artifactId>
          <groupId>org.springframework</groupId> </exclusion> <exclusion>
          <artifactId>commons-beanutils</artifactId>
          <groupId>commons-beanutils</groupId> </exclusion> </exclusions>
          </dependency
      -->
    <dependency>
        <groupId>org.springmodules</groupId>
        <artifactId>spring-modules-cache</artifactId>
        <version>0.8a</version>
        <exclusions>
            <!--
                    Exclusions to make up for the fact that the 0.8a POM for
                    spring-modules-cache isn't marking many of its optional
                    dependencies as optional. TO DO - add some more exclusions if
                    possible
                -->
            <exclusion>
                <artifactId>ehcache</artifactId>
                <groupId>ehcache</groupId>
            </exclusion>
            <exclusion>
                <groupId>gigaspaces</groupId>
                <artifactId>gigaspaces-ce</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>webster</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jboss</groupId>
                <artifactId>jboss-jmx</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xpp3</groupId>
                <artifactId>xpp3_min</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>start</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jboss</groupId>
                <artifactId>jboss-minimal</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>reggie</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jboss</groupId>
                <artifactId>jboss-cache</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jcs</groupId>
                <artifactId>jcs</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jboss</groupId>
                <artifactId>jboss-system</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>jsk-platform</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jboss</groupId>
                <artifactId>jboss-common</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>mahalo</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>jsk-lib</artifactId>
            </exclusion>
            <exclusion>
                <groupId>jini</groupId>
                <artifactId>boot</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!--
          dependency> <groupId>com.googlecode.ehcache-spring-annotations
          </groupId> <artifactId>ehcache-spring-annotations </artifactId>
          <version>1.1.2</version> <type>jar</type> <scope>compile</scope>
          </dependency
      -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.1</version>
    </dependency>
    <!--dependency>
          <artifactId>ehcache</artifactId>
          <groupId>ehcache</groupId>
          <version>${ehcache.version}</version>
      </dependency-->
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>2.4.1</version>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-terracotta</artifactId>
        <version>2.4.1</version>
    </dependency>
    <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>terracotta-toolkit-1.2-runtime</artifactId>
        <version>3.0.0</version>
    </dependency>
    <dependency>
        <groupId>local-simplecaptcha</groupId>
        <artifactId>local-simplecaptcha</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/simplecaptcha-1.2.1.jar
        </systemPath>
    </dependency>
    <dependency>
        <artifactId>solr-solrj</artifactId>
        <groupId>org.apache.solr</groupId>
        <version>1.4.0</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <artifactId>solr-core</artifactId>
        <groupId>org.apache.solr</groupId>
        <version>1.4.0</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.7</version>
        <scope>test</scope>
    </dependency>
</dependencies>
我正在使用的其他技术:
EhCache、Solr、MySQL
旧设置曾经在我的第一台计算机上运行得非常好,但是当我切换到新系统(计算机)时,突然间很多休眠依赖项等丢失了,我做了很多尝试和错误来解决 Spring 和 Hibernate 的各种依赖项。
如果有人能给我一个清醒的解决方案,我将不胜感激,这样我就可以让我的 webapp 恢复工作模式
我正在开发一些 maven 2 版本,但如果我必须切换到 maven 3 等,我也准备好了。我只需要一个端到端的解决方案,而无需打扰我的代码。