【问题标题】:Maven 3 Eclipse Kepler is it necessary to have the environment variable to work for embedded Maven?Maven 3 Eclipse Kepler 是否需要环境变量才能为嵌入式 Maven 工作?
【发布时间】:2014-05-22 12:04:50
【问题描述】:

我已经安装了最新版本的开普勒,其中嵌入了 maven 当我多次尝试从任何原型创建应用程序时 我总是有

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)

即使:

  1. 我已删除 .m2 中的存储库文件夹,并由它自己再次创建
  2. 我已经下载了一个外部maven并使用了它
  3. 我在嵌入式和外部都做了代理

还有其他想法吗?我的settings.xml

  <?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
 </pluginGroups>
 <proxies>
  <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>stsproxy</host>
      <port>8080</port>
      <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>
 <servers>
 </servers>
 <mirrors>
 </mirrors>
 <profiles>
 </profiles>
</settings>

请注意:
我已经尝试了Create a Maven project in Eclipse complains "Could not resolve archetype" 中的所有灵魂,除了由于公司限制为 maven 制作一个变量,那么这个变量是运行嵌入式版本所必需的吗?

【问题讨论】:

    标签: java eclipse maven


    【解决方案1】:

    即使我在代理之外使用它只是使用了外部版本,嵌入式版本似乎也存在错误

    然后使用wagon-http-lightweight-2.2.jar,如中所述 Can access maven repository from behind proxy, need help

    它的工作原理

    【讨论】:

      【解决方案2】:

      我不确定 Kepler 是否仍然相同,但在早期的 Eclipse(和 M2E)版本中,如果您转到 Window -&gt; Preferences -&gt; Maven -&gt; Installations 并添加您的本地外部 Maven 安装,这个问题通常会消失,这通常会导致 Eclipse选择正确的settings.xml 文件。

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多