maven未能解决原型ear-jee5

时间:2011-06-09 06:32:35

标签: maven ear java-ee-5 maven-archetype

我正在尝试使用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模块创建项目结构的替代方法吗?

感谢。

1 个答案:

答案 0 :(得分: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>

由于