0
  1. I started doing this tutorial, on win 8.1.
  2. I downloaded JDK8 and Maven.
  3. I set up Maven (added mvn to PATH, set JAVA_HOME).

    • Output from mvn --version:

      Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00) Maven home: C:\apache\apache-maven-3.3.9\bin\.. Java version: 1.8.0_122-ea, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_122\jre Default locale: en_US, platform encoding: Cp1255 OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"

  4. Created folder for the project.

  5. tried to run this command (copy-paste from the tutorial, ignore the line breaks in SO): mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeGroupId=org.apache.maven.archetypes -DinteractiveMode=false -DgroupId=com.example.employees -DartifactId=employees-app -DarchetypeVersion=1.0

    • output from command: pastebin
    • summary of the output: No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\yogevl\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

Answers in SO assumes I have a proxy. I don't, I checked it here. Plus, I am able to get to the repo using Chrome. Another answer advised to run the cmd as an Administrator. I did - same result.

I also followed the link at the end of the output:

  1. Don't think so, because I copy-pasted from the toturial.
  2. Ditto.
  3. Ditto.
  4. Not sure about this one - the settings.xml is the default file. Do I need to change it?
  5. Same as 1-3.

Thank you for your help!

Yogev Levy
  • 325
  • 3
  • 16
  • Do not put links to pastebin etc. cause some are not able to access them. Better post output into the post in SO... – khmarbaise Dec 22 '16 at 10:17
  • I'm using a proxy, and I got this result from lagado.com (the test link you provided) : **Proxy Test: This request appears NOT to have come via a proxy.** Are you in an office or at home? – JimHawkins Dec 22 '16 at 12:08
  • 1
    This looks like a https cert error. I would guess the CA authority used by https://repo.maven.apache.org/maven2/ is not trusted in your java cacerts file but is trusted in chrome. Here is a good link to get you started: http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art032 but you need the cert for repo.maven.apache.org not maven.2xoffice.com – Revive Dec 22 '16 at 12:12
  • @I-LOVE-2-REVIVE - I'm using the standard cacerts file which is shipped with JDK 8, and I don't have any problems. – JimHawkins Dec 22 '16 at 12:20
  • 1
    @JimHawkins yup me too and it works fine. http://imgur.com/gallery/PnvK7v6 :) Nevertheless if Yogev says he is not using a proxy its my guess: http://stackoverflow.com/a/25912982/3656963 – Revive Dec 22 '16 at 12:41
  • @I-LOVE-2-REVIVE - thanks, good to know. What do you think about the proxy test on lagado.com ? – JimHawkins Dec 22 '16 at 13:03

2 Answers2

1

After reading the comments here, the solution was to update the cacerts file, since it was lacking the proper certificate for the Maven repo (thanks I-LOVE-2-REVIVE for the answer and the link).

So, if you have the same problem I had, here some things:

  1. This article will guide you how to add the certificate to the cacerts file (Again, thanks I-LOVE-2-REVIVE for the link). Make sure you add the certificate for the repo you need.
  2. Remember that each jdk/jde manages a different certificate list.
  3. The keytool is located at %JAVA_HOME%\bin (at first I thought it was a linux shell tool, it's not).
Community
  • 1
  • 1
Yogev Levy
  • 325
  • 3
  • 16
0

Insert appropriate proxy settings to your file ~/.m2/settings.xml (On Windows probably C:\Users\you\.m2\settings.xml):

<settings>
    ...
    <proxies>
        <proxy>
            <id>optional</id>
            <active>true</active>
            <protocol>http</protocol>
            <username></username> <!-- perhaps empty, ask admin  -->
            <password></password>
            <host>proxy.your.company.com</host>
            <port>8080</port>
            <nonProxyHosts>localhost|other.server.com</nonProxyHosts>
        </proxy>
    </proxies>
    ...
</settings>
JimHawkins
  • 4,843
  • 8
  • 35
  • 55