我想用Maven創建一個Spring Struts Hibernate Web應用程序。我的,項目的pom.xmlSpring Struts休眠Maven項目錯誤
*<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>satunol</groupId>
<artifactId>PMS</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>PMS Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-servlet-webserver</artifactId>
<version>1.9.36</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>2.0.1</version>
</dependency>
<!-- jUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8</version>
</dependency>
<!-- MySQL database driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
</dependency>
<!-- Struts 2 + Spring plugins -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.1.8</version>
</dependency>
<!-- Hibernate core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
</dependency>
<!-- Hibernate core library dependency start -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<!-- Hibernate core library dependency end -->
<!-- Hibernate query library dependency start -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<!-- Hibernate query library dependency end -->
</dependencies>
<build>
<finalName>PMS</finalName>
</build>
</project>
但我得到的錯誤是這樣,
故障轉移org.codehaus.plexus:從http://repo1.maven.org/maven2在當地被緩存1.2:叢存檔器:罐子在中央更新間隔結束或強制更新之前,不會重新解析分辨率。原始錯誤:無法傳輸工件org.codehaus.plexus:plexus-archiver:jar:1.2 from/to central(http://repo1.maven.org/maven2):沒有路由到主機:沒有更多信息http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/1.2/plexus-archiver-1.2.jar
缺少神器的com.sun:工具:罐子:1.5.0
缺少神器javax.transaction的:JTA:罐子:1.0.1B
我怎樣才能解決這個問題,謝謝。
不,我的網絡不使用代理。 –
您調用什麼Maven目標/階段來獲取錯誤?我能夠用你的**精確** POM(第一行減去兩個星號)運行'mvn clean',沒有錯誤。 –
和你一樣,當我在我的項目中從cmd運行mvn clean時,BUILD BUILD SUCCESS。但是,當我在Eclipse中看到我的pom.xml時,它有3個錯誤,我上面提到過,當我嘗試打開http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/ 1.2/plexus-archiver-1.2.jar從我的瀏覽器中,沒有問題。我的Elcipse沒有使用代理。它在網絡連接設置中使用「本機」連接。 –