PluginResolutionException when I run mvn test on the project

7k Views Asked by At

I give the following commands in command line. As you can see, there is an error, the connection is timed out. I have set the environment variables as the following :

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

Here the pom file details :

<?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>

Ask for any other details if required.Any help is appreciated.

2

There are 2 best solutions below

2
On

I think the path of M2_HOME is not correct ... M2_HOME=C:\Users\user1\Desktop\SQLToNoSQLImporter-master\SQLToNoSQLImporater-master.. M2_HOME should point to Maven binary like

M2_HOME=C:\apache-maven-3.2.5\

0
On

Try following versions of dependencies

<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>