【问题标题】:Error in converted maven project in Eclipse在 Eclipse 中转换的 Maven 项目中的错误
【发布时间】:2013-01-28 08:59:35
【问题描述】:

我正在使用带有 m2e 插件的 Eclipse Juno。我通过 Eclipse 将我的 java 项目转换为 maven 项目

右键项目>转到菜单配置>转换为maven项目。

这些是错误:

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-
 plugin:2.3.2:compile (execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-
 plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-
 compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of 
 its dependencies could not be resolved: The following artifacts could not be resolved: 
 org.codehaus.plexus:plexus-compiler-manager:jar:1.8.1, org.codehaus.plexus:plexus-compiler-javac:jar:1.8.1: 
 Failure to transfer org.codehaus.plexus:plexus-compiler-manager:jar:1.8.1 from http://repo.maven.apache.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central 
 has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-compiler-
 manager:jar:1.8.1 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://
 repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-
 manager-1.8.1.jar
- CoreException: Could not get the value for parameter compilerId for plugin execution default-
 testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one 
 of its dependencies could not be resolved: The following artifacts could not be resolved: 
 org.codehaus.plexus:plexus-compiler-manager:jar:1.8.1, org.codehaus.plexus:plexus-compiler-javac:jar:1.8.1: 
 Failure to transfer org.codehaus.plexus:plexus-compiler-manager:jar:1.8.1 from http://repo.maven.apache.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central 
 has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-compiler-
 manager:jar:1.8.1 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://
 repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-
 manager-1.8.1.jar

如何解决这个问题? 请帮忙。

【问题讨论】:

  • 似乎是网络问题,因为您的日志显示 plexus-compiler-manager-1.8.1.jar 由于网络超时而无法下载。尝试创建一个 vanilla maven 项目设置并确保其有效,然后重试该项目。让 vanilla 项目正常工作后,重新启动 Eclipse 并刷新完整的项目。
  • 对于从 Eclipse、Maven、M2E 和 GWT 开始的初学者来说,很难要求增加所有新事物。您可以改为从 GWT Maven 示例项目开始,然后使用 "Import" -> "Existing Maven projects" 将其导入 eclipse。可从此处下载 GWT 的示例文件夹 -> google-web-toolkit.googlecode.com/files/gwt-2.5.0.zip
  • 我注意到您的屏幕截图中有“selenium”。您确定需要用 GWT 标记它吗?
  • 嗯,我这样做是因为我想测试我的 gwt 应用程序。
  • 看那里:stackoverflow.com/questions/8834806/m2eclipse-error 这解决了你的问题吗?

标签: java gwt maven selenium


【解决方案1】:

Eclipse Juno 在创建 Maven 项目时遇到一些问题,最好的方法是创建 Maven 项目,创建 Java 并转换它。

Juno 在 Maven 的生命周期配置方面也存在问题,在构建、编译、安装方面。所以请也自动关闭您的构建。

按照以下说明解决此问题。

检查您在 Eclipse 上的代理设置是否在您的公司网络后面。

要更改此转到-> 窗口-> 首选项-> 常规-> 网络连接并更改活动提供程序。

如果您有一些代理详细信息,请选择 Manaul 作为活动提供者并对其进行编辑。 添加代理详细信息,即主机名和端口,然后单击保存。

否则,请尝试从您的公司网络团队获取。

通过Goto->window->prefernces->Maven->用户设置在此goto maven设置之后

检查是否存在名为settings.xml的xml文件,如果没有将下面的代码添加到文件中并保存在路径上。

作为参考,它将位于:users\your name.m2

<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">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors/>
  <proxies>
    <proxy>
      <id>myproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy name</host>
      <port>number</port>
      <username></username>
      <password></password>
      <nonProxyHosts>localhost,127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>
  <profiles/>
  <activeProfiles/>
</settings>

即使在此之后,如果它不起作用, 转到命令提示符。 导航到项目位置。 一个接一个地输入命令。 - mvn 清洁 - mvn 编译 - mvn 安装

希望它对你和其他人有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    • 2011-11-01
    • 2013-07-07
    • 2013-10-29
    相关资源
    最近更新 更多