在公司服务器上运行mvn clean test 或者 mvn clean compile时,出现错
[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>