首页 文章

Maven:在eclipse中安装了Maven插件,但是POM.xml有一些错误

提问于
浏览
0

我已成功在eclipse中安装了Maven插件,并在eclipse中生成了POM.xml,但是POM.xml发出了一些错误,

my POM.xml :

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>SeleniumApp</groupId>
  <artifactId>SeleniumApp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</project>

Errors are showing :

*** CoreException:

无法计算构建计划:插件org.apache.maven.plugins:maven-compiler-plugin:3.5.1或其中一个依赖项无法解析:无法读取org.apache.maven.plugins的工件描述符:maven -compiler-plugin:jar:3.5.1:ArtifactResolutionException:无法从https://repo.maven.apache.org/maven2转移org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.1缓存在本地存储库中,在中心的更新间隔过去或强制更新之前,不会重新尝试解析 . 原始错误:无法传输工件org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.1 from / to central(https://repo.maven.apache.org/maven2):connect timed out

任何帮助 .

2 回答

  • 0

    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-api -->
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-api</artifactId>
    <version>2.0rc2</version>
    </dependency>
    
  • 0

    这可能会解决您的问题,POM.xml正确 not Configured

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
     <groupId>SeleniumApp</groupId>
     <artifactId>SeleniumApp</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <packaging>jar</packaging>
     <name>SeleniumApp</name>
     <url>http://maven.apache.org</url>
    
     <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
    
    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
          <resource>
            <directory>src</directory>
            <excludes>
              <exclude>**/*.java</exclude>
            </excludes>
          </resource>
        </resources>
    
        <plugins>
              <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                  <source>1.7</source>
                  <target>1.7</target>
                </configuration>
              </plugin>
              <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                  <warSourceDirectory>WebContent</warSourceDirectory>
                </configuration>
              </plugin>
        </plugins>
    </build>
    
    <dependencies>
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-api -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-api</artifactId>
            <version>2.0rc2</version>
        </dependency>
    </dependencies>
    
    </project>
    

相关问题