1

我正在尝试以ear-jee5 作为原型创建一个EAR maven 模块项目(在eclipse 中)。它失败并出现以下错误。

Could not resolve archetype org.codehaus.mojo.archetypes:ear-jee5:1.3 from any of the configured repositories.
Could not resolve artifact
Missing org.codehaus.mojo.archetypes:ear-jee5:pom:1.3

有人可以帮我解决这个错误或向我展示另一种为 Maven EAR 模块创建项目结构的方法吗?

谢谢。

4

1 回答 1

1

显然,失败似乎是因为我在办公室的代理/防火墙后面。解决方案是在 settings.xml 中添加代理配置或添加未被防火墙阻止的存储库镜像。

希望这可以帮助某人。

添加代理

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

或镜子

  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
  <mirrors>

谢谢

于 2011-06-10T04:49:05.600 回答