selenium Eclipse中转换的maven项目出错

gstyhher  于 2023-06-29  发布在  Eclipse
关注(0)|答案(2)|浏览(165)

我正在使用Eclipse Juno和m2 e插件。我通过Eclipse将Java项目转换为Maven项目
右键单击project >后藤菜单configure > Convert to maven project。

这些是错误:

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

如何解决这一问题?请帮帮我

4dc9hkyq

4dc9hkyq1#

Eclipse Juno在创建Maven项目时遇到一些问题,最好的方法是创建Maven项目,创建Java并转换它。
Juno在构建、编译和安装Maven的生命周期配置方面也存在问题。所以请自动关闭您构建。
按照以下说明解决此问题。
检查Eclipse上的代理设置是否位于公司网络的后面。
要更改此后藤,请转到->窗口->首选项->通用->网络连接并更改活动提供商。
如果您有一些代理详细信息,请选择Manaul作为活动提供程序并对其进行编辑。添加代理详细信息,即主机名和端口,然后单击保存。
否则,请尝试从您的公司网络团队获取。
在此之后,通过Goto->window->prefernces->Maven-> user settings转到maven设置
检查是否有名为settings.xml的xml文件,如果没有,将以下代码添加到文件中并保存在路径上。
作为参考,它将位于:users\您的姓名. 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 clean - mvn compile - mvn install
我希望它能为你和其他人工作。

bfhwhh0e

bfhwhh0e2#

您可以右键单击您的项目,然后Maven > Update Project...,然后选择Force Update of Snapshots/Releases复选框,然后单击OK。

相关问题