mvn archetype:generate does not work-no plugin found for prefix 'archetype'

后端 未结 15 1319
挽巷
挽巷 2020-12-01 09:05

I want to build a simple project using a existing archetype. But I can\'t run mvn archetype:generate as it keeps telling me the following information

         


        
相关标签:
15条回答
  • 2020-12-01 09:39

    This is the issue with your firewall. To check if firewall is on:

    Click Start-> click Run-> type wscui.cpl -> click OK. In Windows Security Center-> click Security If net work Network Firewall is "on" you need to set the proxy for maven.

    Go to /conf -> open settings.xml with notepad uncomment proxy (if you don't remember proxy settings u can check in webbrowser u r using)

    <proxies>
        <proxy>
            <id>optional</id>
            <active>true</active>
            <protocol>http</protocol>
            <username></username>
            <password></password>
            <host>www-proxy.us.oracle.com</host>
            <port>80</port>
            <nonProxyHosts></nonProxyHosts>
        </proxy>
    </proxies>
    

    You can leave the username and pwd fields blank and set only host and port.

    0 讨论(0)
  • 2020-12-01 09:39
    • To add Venerik's answer I would elaborate a bit for the naive users like me;

    proxy settings in maven go to apache-maven-3.3.9\conf folder and find settings.xml open it in any text editor go to the block of code that looks like below

     <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
     </proxies>
    
    • Now uncomment the code from (proxy.../proxy) by cutting it and pasting it

    just after (proxies).

    Now change according to your proxy settings In my case it looks like the following

    <proxies>
      <proxy>
          <id>optional</id>
          <active>true</active>
          <protocol>http</protocol>      
          <host>authproxy.serc.iisc.ernet.in</host>
          <port>3128</port>
          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
      </proxy>
      <!-- proxy
         | Specification for one proxy, to be used in connecting to the      network.
     |
       -->
      </proxies>
    

    Now try running mvn archetype:generate and it should run and download

    0 讨论(0)
  • 2020-12-01 09:44

    Another problem with Windows (Vista ,Windows 7 onward) is that the command prompt should be running under Administrative privileges (Right click command prompt shortcut and choose "Run ad Administrator" if UAC is on), so simply run command prompt as Administrator before executing mvn archetype:generate.

    I had faced this issue while creating vaadin 7 project under windows 7 using following command.

    mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.8 -DgroupId=im.sma.testproject -DartifactId=testproject -Dversion=1.0 -Dpackaging=war
    
    • SMA
    0 讨论(0)
  • 2020-12-01 09:44

    In my case the solution was just run mvn archtype:generate in Safe Mode under your user profile. After that I could run it in normal boot.

    0 讨论(0)
  • 2020-12-01 09:45

    I have face the same problem when using maven 3.6.1 with jdk 1.7.40.

    To solve this, i simply update my version of JDk to 1.8.241.

    I hope this will help you.

    0 讨论(0)
  • 2020-12-01 09:47

    I solved this problem disabling the antivirus for a few time while the project is create .

    Click here how to do that with avast

    0 讨论(0)
提交回复
热议问题