首页 > 解决方案 > 收到错误消息“无法在项目上执行目标 org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install)”

问题描述

Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project iGateVacationServices: Execution default-install of goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install failed: Plugin org.apache.maven.plugins:maven-install-plugin:2.5.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-install-plugin:jar:2.5.2 -> org.apache.maven:maven-project:jar:2.2.1 -> org.apache.maven:maven-settings:jar:2.2.1 -> org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 -> junit:junit:jar:3.8.1: Failed to read artifact descriptor for junit:junit:jar:3.8.1: Could not transfer artifact junit:junit:pom:3.8.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.112.215] failed: Connection timed out: connect -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[JENKINS] Archiving D:\Selenium\iGATEVacationService\iGateVacationServices\pom.xml to iGateVacationServices/iGateVacationServices/0.0.1-SNAPSHOT/iGateVacationServices-0.0.1-SNAPSHOT.pom

我的测试执行正常,但是在打印报告时,它在 Jenkins 中显示以下错误。需要帮助以了解我在添加依赖项或插件时是否犯了任何错误。

我正在使用 JDK1.8、TestNG、Selenium、Maven 和 Jenkins。

我的 POM.XML 依赖项和插件如下

  <dependencies>
     <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>  

    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.14.3</version>
    <scope>compile</scope>
 </dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>4.0.0</version>
</dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>4.0.0</version>
</dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-scratchpad</artifactId>
    <version>4.0.0</version>
</dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>ooxml-schemas</artifactId>
     <version>1.4</version>
</dependency>

<dependency>
            <groupId>org.apache.maven.surefire</groupId>
             <artifactId>surefire-testng</artifactId>
            <version>3.0.0-M1</version>
          </dependency>

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-install-plugin</artifactId>
  <version>3.0.0-M1</version>
  <type>maven-plugin</type>
</dependency>

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
    <scope>system</scope>
    <systemPath>${basedir}/ojdbc6.jar</systemPath>
</dependency>


<dependency>
    <groupId>com.relevantcodes</groupId>
    <artifactId>extentreports</artifactId>
    <version>2.41.2</version>
</dependency>


  </dependencies>

  <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>

    <plugin>
      <artifactId>maven-clean-plugin</artifactId>
      <version>3.0.0</version>
    </plugin>
    <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.0.2</version>
    </plugin>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.7.0</version>
      </plugin>

    <plugin>
      <artifactId>maven-jar-plugin</artifactId>
      <version>3.0.2</version>
    </plugin>
    <plugin>
      <artifactId>maven-install-plugin</artifactId>
      <version>2.5.2</version>
    </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <verbose>true</verbose>
            </configuration>
        </plugin>


    <plugin>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.8.2</version>
    </plugin>

    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.20.1</version>
      <inherited>true</inherited>
      <configuration>
            <suitXmlFiles>${suiteFile}</suitXmlFiles>
      </configuration>
    </plugin>

  </plugins>

标签: mavenseleniumjenkins

解决方案


推荐阅读