5

I am using Maven for the first time . I am trying to add spring-core.jar to my local Maven repo.

Maven command:

C:\Users\user\.m2\repository>mvn install:install-file -Dfile=C:\spring-core-4.2.0.RELEASE.jar -DgroupId=org.springframework -DartifactId=spring-core -Dversion=4.2.0.RELEASE -Dpackaging=jar

Error message:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.5/plexus-utils-3.0.5.pom
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.pom
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Unrecognized Windows Sockets error: 10106: create
Dec 12, 2015 11:56:38 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.414 s
[INFO] Finished at: 2015-12-12T11:56:38+05:30
[INFO] Final Memory: 9M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven
    .plugins:maven-install-plugin:2.4:install-file failed: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to collect d
    ependencies at org.apache.maven.plugins:maven-install-plugin:jar:2.4 -> org.codehaus.plexus:plexus-utils:jar:3.0.5: Failed to read artifact descriptor for org.codehaus.plexus:plexus
    -utils:jar:3.0.5: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0.5 from/to central (https://repo.maven.apache.org/maven2): Unrecognized Windows Sockets error:
    10106: create -> [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

Please some one help me to sort out this error and also let me know how to add external jars to my maven repository. Thanks!

2 Answers 2

3

This message:

java.net.SocketException: Unrecognized Windows Sockets error: 10106: create

means Maven can't open the port 10106. Either this port is blocked or it's used.

Scan the ports, i.e. under Windows:

Windows+R ---> cmd ---> enter
netstat -b

Sign up to request clarification or add additional context in comments.

Comments

2

@letmedoit : Could you explain why you need to add manually an artifact to your local maven repository ?

IMHO, it would be better to create a pom.xml file and just run it.

Add this file (pom.xml) somewhere on your computer : <?xml version="1.0" encoding="UTF-8"?> <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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>yourGroupId</groupId> <artifactId>yourArtifactId</artifactId> <version>0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.2.0.RELEASE</version> </dependency> </dependencies> </project> then just run the maven command into the directory where you put the previous file mvn compile.

It should do the dowload of the artifact, as you can see: [INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building yourArtifactId 0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-core/4.2.0.RELEASE/spring-core-4.2.0.RELEASE.pom Downloaded: https://repo.maven.apache.org/maven2/org/springframework/spring-core/4.2.0.RELEASE/spring-core-4.2.0.RELEASE.pom (3 KB at 5.4 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-core/4.2.0.RELEASE/spring-core-4.2.0.RELEASE.jar Downloaded: https://repo.maven.apache.org/maven2/org/springframework/spring-core/4.2.0.RELEASE/spring-core-4.2.0.RELEASE.jar (1028 KB at 78.9 KB/sec) [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ yourArtifactId --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /tmp/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ yourArtifactId --- [INFO] No sources to compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 15.455 s [INFO] Finished at: 2015-12-12T11:02:37+01:00 [INFO] Final Memory: 10M/147M [INFO] ------------------------------------------------------------------------

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.