当我在项目上运行mvn test时,PluginResolutionException

时间:2015-06-16 07:20:55

标签: maven maven-3

我在命令行中提供以下命令。如您所见,出现错误,连接超时。我已将环境变量设置为以下内容:

M2_HOME=C:\app\apache-maven-3.3.3
M2= %M2_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m
C:\Users\user1\Desktop\SQLToNoSQLImporter-master\SQLToNoSQLImporter-maste
r>mvn test -DimportConf=/Users/sathis/Desktop/data-import.properties -DdbConf=/U
sers/sathis/Desktop/data-config.xml
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SQLToNoSQLImporter 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.282 s
[INFO] Finished at: 2015-06-16T12:30:31+05:30
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its
 dependencies could not be resolved: Failed to read artifact descriptor for org.
apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact
 org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https:
//repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.mave
n.apache.org/23.235.44.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException

这里的pom文件详细信息:

<?xml version="1.0" encoding="UTF-8"?>

-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">

<modelVersion>4.0.0</modelVersion>

<groupId>org.sathis</groupId>

<artifactId>SQLToNoSQLImporter</artifactId>

<version>1.0-SNAPSHOT</version>


-<dependencies>


-<dependency>

<groupId>commons-io</groupId>

<artifactId>commons-io</artifactId>

<version>2.4</version>

</dependency>


-<dependency>

<groupId>commons-logging</groupId>

<artifactId>commons-logging</artifactId>

<version>1.1</version>

</dependency>


-<dependency>

<groupId>commons-dbutils</groupId>

<artifactId>commons-dbutils</artifactId>

<version>1.5</version>

</dependency>


-<dependency>

<groupId>commons-lang</groupId>

<artifactId>commons-lang</artifactId>

<version>2.6</version>

</dependency>


-<dependency>

<groupId>net.sf.json-lib</groupId>

<artifactId>json-lib</artifactId>

<version>2.4</version>

<classifier>jdk15</classifier>

</dependency>


-<dependency>

<groupId>org.apache.httpcomponents</groupId>

<artifactId>httpclient</artifactId>

<version>4.3.5</version>

</dependency>


-<dependency>

<groupId>org.mongodb</groupId>

<artifactId>mongo-java-driver</artifactId>

<version>2.12.3</version>

</dependency>


-<dependency>

<groupId>org.elasticsearch</groupId>

<artifactId>elasticsearch</artifactId>

<version>1.3.1</version>

</dependency>

<!--- Optional Dependencies -->


<!-- PostgreSQL driver. comment this if you are not using -->



-<dependency>

<groupId>postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>9.1-901.jdbc4</version>

</dependency>

<!-- MySQL driver. comment this if you are not using -->



-<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>5.1.31</version>

</dependency>

<!-- Oracle driver not available in maven. Please put the jar in libs folder. -->


</dependencies>


-<build>


-<plugins>


-<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>exec-maven-plugin</artifactId>

<version>1.2.1</version>


-<executions>


-<execution>

<phase>test</phase>


-<goals>

<goal>java</goal>

</goals>


-<configuration>

<mainClass>net.sathis.export.sql.SQLToNoSQLImporter</mainClass>


-<arguments>

<argument>${importConf}</argument>

<argument>${dbConf}</argument>

</arguments>

</configuration>

</execution>

</executions>

</plugin>

</plugins>

</build>

</project>

如果需要,请询问任何其他详细信息。感谢任何帮助。

2 个答案:

答案 0 :(得分:0)

我认为M2_HOME的路径不正确... M2_HOME = C:\ Users \ user1 \ Desktop \ SQLToNoSQLImporter-master \ SQLToNoSQLImporater-master .. M2_HOME应该指向Maven二进制文件

M2_HOME = C:\ Apache的行家-3.2.5 \

答案 1 :(得分:0)

尝试以下版本的依赖项

<dependency>
	<groupId>commons-logging</groupId>
	<artifactId>commons-logging</artifactId>
	<version>1.2</version>
</dependency>


<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5</version>
</dependency>

<dependency>
	<groupId>org.mongodb</groupId>
	<artifactId>mongo-java-driver</artifactId>
	<version>3.0.2</version>
</dependency>

<dependency>
	<groupId>org.elasticsearch</groupId>
	<artifactId>elasticsearch</artifactId>
	<version>1.6.0</version>
</dependency>

<dependency>
	<groupId>postgresql</groupId>
	<artifactId>postgresql</artifactId>
	<version>9.1-901.jdbc4</version>
</dependency>

<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>5.1.35</version>
</dependency>