未能执行goal org.apache.mavenplugins:maven-war-plugin:2.5:战争

rqcrx0a6  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(300)

我在我的系统中安装了jdk7,也安装了maven mvn clean verify tomcat7:run 此命令生成始终失败,错误如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.5:war (default-war) on 
project fmissampletestdriver: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.5:war failed: 
Plugin org.apache.maven.plugins:maven-war-plugin:2.5 or one of its dependencies could not be resolved: 
Failed to collect dependencies at org.apache.maven.plugins:maven-war-plugin:jar:2.5 ->
 org.apache.maven:maven-core:jar:2.2.1 -> org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: 
Failed to read artifact descriptor for org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: 
Could not transfer artifact org.apache.maven.reporting:maven-reporting-api:pom:2.2.1 from/to central
 (https://repo.maven.apache.org/maven2): Transfer failed for 
https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.pom:

Received fatal alert: protocol_version -> [Help 1]

命令提示输出

Microsoft Windows [Version 10.0.18363.1256]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\aksha>cd C:\Users\aksha\fmis-sample-test-driver

C:\Users\aksha\fmis-sample-test-driver>mvn clean verify tomcat7:run
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.ncrcoe.di.test:fmissampletestdriver >---------------
[INFO] Building Test Driver for Sample TPV 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fmissampletestdriver ---
[INFO] Deleting C:\Users\aksha\fmis-sample-test-driver\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ fmissampletestdriver ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ fmissampletestdriver ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 6 source files to C:\Users\aksha\fmis-sample-test-driver\target\classes
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/main/java/com/ncr/di/genenveloped/util/DocumentSigner.java: C:\Users\aksha\fmis-sample-test-driver\src\main\java\com\ncr\di\genenveloped\util\DocumentSigner.java uses unchecked or unsafe operations.
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/main/java/com/ncr/di/genenveloped/util/DocumentSigner.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ fmissampletestdriver ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ fmissampletestdriver ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 5 source files to C:\Users\aksha\fmis-sample-test-driver\target\test-classes
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[5,24] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[66,15] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[66,56] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ fmissampletestdriver ---
[INFO] Surefire report directory: C:\Users\aksha\fmis-sample-test-driver\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.ncr.di.genenveloped.data.AssertionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.306 sec
Running com.ncr.di.genenveloped.data.SAMLResponseTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.27 sec
Running com.ncr.di.genenveloped.util.DocumentSignerTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.174 sec
Running com.ncr.di.genenveloped.util.ResponseSenderTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.1 sec

Results :

Tests run: 31, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.5:war (default-war) @ fmissampletestdriver ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/commons-cli/commons-cli/1.2/commons-cli-1.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/2.1.3/plexus-io-2.1.3.pom
Downloading from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.2/commons-io-2.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/2.6.3/plexus-archiver-2.6.3.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.19/plexus-interpolation-1.19.pom
Downloading from central: https://repo.maven.apache.org/maven2/com/thoughtworks/xstream/xstream/1.4.4/xstream-1.4.4.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.18/plexus-utils-3.0.18.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/1.2/maven-filtering-1.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-mapping/1.0/maven-mapping-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.312 s
[INFO] Finished at: 2020-12-16T14:29:58+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.5:war (default-war) on project fmissampletestdriver: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.5:war failed: Plugin org.apache.maven.plugins:maven-war-plugin:2.5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-war-plugin:jar:2.5 -> org.apache.maven:maven-core:jar:2.2.1 -> org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: Failed to read artifact descriptor for org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: Could not transfer artifact org.apache.maven.reporting:maven-reporting-api:pom:2.2.1 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.pom: Received fatal alert: protocol_version -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

我的pom.xml文件

<?xml version='1.0' encoding='UTF-8'?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<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>

  <parent>
    <artifactId>maven-plugins</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>25</version>
    <relativePath>../maven-plugins/pom.xml</relativePath>
  </parent>

  <artifactId>maven-war-plugin</artifactId>
  <version>2.5</version>
  <packaging>maven-plugin</packaging>

  <name>Apache Maven WAR Plugin</name>
  <description>Builds a Web Application Archive (WAR) file from the project output and its dependencies.</description>

  <prerequisites>
    <maven>${mavenVersion}</maven>
  </prerequisites>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-war-plugin-2.5</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-war-plugin-2.5</developerConnection>
    <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-war-plugin-2.5</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/browse/MWAR</url>
  </issueManagement>
  <distributionManagement>
    <site>
      <id>apache.website</id>
      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/${maven.site.path}</url>
    </site>
  </distributionManagement>

  <properties>
    <mavenArchiverVersion>2.5</mavenArchiverVersion>
    <mavenFilteringVersion>1.2</mavenFilteringVersion>
    <mavenVersion>2.2.1</mavenVersion>
    <mavenPluginPluginVersion>3.2</mavenPluginPluginVersion>
  </properties>

  <contributors>
    <contributor>
      <name>Auke Schrijnen</name>
    </contributor>
    <contributor>
      <name>Ludwig Magnusson</name>
    </contributor>
    <contributor>
      <name>Hayarobi Park</name>
    </contributor>
  </contributors>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-archiver</artifactId>
      <version>${mavenArchiverVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- FIXME: Check for Maven 2.2.1 / Maven 3 compatibility. -->
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-io</artifactId>
      <version>2.1.3</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.2</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-archiver</artifactId>
      <version>2.6.3</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-interpolation</artifactId>
      <version>1.19</version>
    </dependency>

    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
      <version>1.4.4</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.0.18</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-filtering</artifactId>
      <version>${mavenFilteringVersion}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-mapping</artifactId>
      <version>1.0</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <project.build.directory>${project.build.directory}</project.build.directory>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <goals>
                <goal>clean</goal>
                <goal>package</goal>
              </goals>
              <projectsDirectory>src/it</projectsDirectory>
              <postBuildHookScript>verify</postBuildHookScript>
              <preBuildHookScript>prebuild</preBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
            </configuration>
            <executions>
              <execution>
                <id>install</id>
                <phase>pre-integration-tests</phase>
                <goals>
                  <goal>install</goal>
                </goals>
                <configuration>
                  <extraArtifacts>
                    <extraArtifact>javax.servlet:servlet-api:2.4:jar</extraArtifact>
                    <extraArtifact>org.apache.struts:struts-core:1.3.9:jar</extraArtifact>
                    <extraArtifact>org.codehaus.plexus:plexus-utils:1.4.7:jar:sources</extraArtifact>
                  </extraArtifacts>
                </configuration>
              </execution>
              <execution>
                <id>verify</id>
                <goals>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题