在公司服务器上运行mvn clean test 或者 mvn clean compile时,出现错

xiaoshuai1991 2016-06-06 05:57:19
[root@NMS xdrMS-Portal]# mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building portal 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:13.907s
[INFO] Finished at: Mon Jun 06 17:55:14 CST 2016
[INFO] Final Memory: 3M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused: Connection timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException



pom.xm配置文件如下:
<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>cn.com.asb</groupId>
<artifactId>xdrMSPortal</artifactId>
<name>portal</name>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<description>xdrMSPortal</description>
<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>protal/WEB-INF/classes</outputDirectory>
<!-- <testSourceDirectory>test</testSourceDirectory> -->
<!--<testOutputDirectory>target/test-classes</testOutputDirectory>-->
<resources>
<resource>
<directory>src</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
</resource>
<resource>
<directory>src/hbm</directory>
<targetPath>hbm</targetPath>
</resource>
</resources>
<testResources>
<testResource>
<directory>test</directory>
<includes>
<include>*.xml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webXml>WebContent/WEB-INF/web.xml</webXml>
<webResources>
<!-- <resource>
<directory>script</directory>
<targetPath>script</targetPath>
</resource>-->
<resource>
<directory>WebContent/commons</directory>
<targetPath>commons</targetPath>
</resource>
<resource>
<directory>WebContent/images</directory>
<targetPath>images</targetPath>
</resource>
<resource>
<directory>WebContent/js</directory>
<targetPath>js</targetPath>
</resource>
<resource>
<directory>WebContent/main</directory>
<targetPath>main</targetPath>
</resource>
<resource>
<directory>WebContent/pages</directory>
<targetPath>pages</targetPath>
</resource>
<resource>
<directory>WebContent/styles</directory>
<targetPath>styles</targetPath>
</resource>
<resource>
<directory>WebContent</directory>
<includes>
<include>*.jsp</include>
<include>*.html</include>
</includes>
</resource>
<resource>
<directory>WebContent/WEB-INF/tld</directory>
<targetPath>WEB-INF/tld</targetPath>
</resource>
<resource>
<directory>WebContent/WEB-INF/springmvc</directory>
<targetPath>WEB-INF/springmvc</targetPath>
</resource>
<resource>
<directory>WebContent/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>*.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</dependency>


...全文
390 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
幺客 2016-06-08
  • 打赏
  • 举报
回复
配置的問題吧,明顯是需要下載pom但是可能由於沒有網絡本地又沒有,所以出錯了
xiaoshuai1991 2016-06-08
  • 打赏
  • 举报
回复
好像是不兼容
tianfang 2016-06-07
  • 打赏
  • 举报
回复
Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused: Connection timed out 连接central库超时 不能分析依赖
xiaoshuai1991 2016-06-06
  • 打赏
  • 举报
回复
插件版本本来是2.4.3,最后才改的2.6.
xiaoshuai1991 2016-06-06
  • 打赏
  • 举报
回复
pom.xml 文件只是一部分,还有一部分没有粘上来

67,514

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧