1. ホーム
  2. メイヴン

[mavenインストールエラー] ゴールの実行に失敗しました org.apache.maven.plugins:maven-war-plugin:2.2:war

2022-03-15 19:51:50
<パス

maven install は以下のエラーを報告します。

[INFO] Scanning for projects...
[INFO] Downloading: http://xxx.xx.xx.x:xxxx/nexus/content/groups/public/DubboDemo/DubboDemo/1.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://xxx.xx.xx.x:xxxx/nexus/content/groups/public/DubboDemo/DubboDemo/1.0-SNAPSHOT/maven-metadata.xml
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for DubboDemo:dubbo-api:war:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> version 3.8.1 vs 4.11 @ DubboDemo:DubboDemo:1.0-SNAPSHOT, D:\java\maven\maven_store\DubboDemo\DubboDemo\1.0-SNAPSHOT\DubboDemo-1.0-SNAPSHOT.pom, line 59, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building dubbo-api Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for io.netty:netty:jar:3.10.5.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dubbo-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ dubbo-api ---
[INFO] Changes detected --- recompiling the module!
[INFO] Compiling 1 source file to D:\java\Workspaces\MyEclipse\dubbo-api\target\classes
[Parsing start time D:\java\Workspaces\MyEclipse\dubbo-api\src\main\java\com\alibaba\dubbo\demo\DemoService.java]
[Parsing completed in 25ms]
[Search path for source file: D:\java\Workspaces\MyEclipse\dubbo-api\src\main\java,]
[Search path for class files: D:\java\jdk1.6.0_45\jre\lib\rt.jar,D:\java\jdk1.6.0_45\jre\lib\jce.jar,D:\java\jdk1.6.0_45\jre\lib\jce.jar,D:\java\jdk1.6.0_45\jre\lib\ext\dns.jar,D:\java \jdk1.6.0_45\jre\lib\ext\localedata.jar,D:\java\jdk1.6.0_45\jre\lib\ext\sunjce_provider.jar,D:\java\jdk1.6.0_45\jre\lib\ext\sunjce_provider sunmscapi.jar,D:\java\jdk1.6.0_45\jre\lib\ext\sunpkcs11.jar,D:\java\Workspaces\MyEclipse\dubbo-api\target\classes,D:\java\maven\ maven_store\jstl\jstl\1.2\jstl-1.2.jar,D:\java\maven\maven_store\javax\javaee-api\7.0\javaee-api-7.0.jar,D:\java\maven\maven_store \com\sun\mail\javax.mail\1.5.0\javax.mail-1.5.0.jar,D:\java\maven\maven_store\javax\activation\activation\1.1\activation-1.1.jar,D :\java\maven\maven_store\org\springframework\spring-core\4.2.5.RELEASE\spring-core-4.2.5.RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-core\4.2.5.RELEASE\spring-core-4.2.5.jar,D:\java\maven\maven_store\ commons-logging\commons-logging\1.2\commons-logging-1.2.jar,D:\java\maven\maven_store\org\springframework\spring-web\4.2.5.RELEASE \spring-web-4.2.5.RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-beans\4.2.5.RELEASE\spring-beans-4.2.5.RELEASE. jar,D:\java\maven\maven_store\org\springframework\spring-oxm\4.2.5.RELEASE\spring-oxm-4.2.5.RELEASE.jar,D:\java\maven\maven_store\ org\springframework\spring-tx-4.2.5.RELEASE\spring-tx-4.2.5.RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-jdbc\ RELEASE\spring-jdbc-4.2.5.RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-webmvc\4.2.5.RELEASE\spring- webmvc-4.2.5.RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-expression\4.2.5.RELEASE\spring-expression-4.2.5. RELEASE.jar,D:\java\maven\maven_store\org\springframework\spring-context\4.2.5.RELEASE\spring-context-4.2.5.RELEASE.jar,D:\java\ maven\maven_store\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar,D:\java\maven\ maven_store\org\springframework\spring-aop\4.2.5.RELEASE\spring-aop-4.2.5.RELEASE.jar,D:\java\maven\maven_store\aopalliance\ aopalliance\1.0\aopalliance-1.0.jar,D:\java\maven\maven_store\org\springframework\spring-test\4.2.5.RELEASE\spring-test-4.2.5. RELEASE.jar,D:\java\maven\maven_store\org\mybatis\mybatis\3.2.8\mybatis-3.2.8.jar,D:\java\maven\maven_store\org\mybatis\mybatis- spring\1.2.2\mybatis-spring-1.2.2.jar,\D:\java\maven\maven_store\mysql\mysql-connector-java\5.1.29\mysql-connector-java-5.1.29.jar, D:\java\maven\maven_store\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar,D:\java\maven\maven_store\commons-pool\commons- pool\1.3\commons-pool-1.3.jar,\D:\java\maven\maven_store\com\alibaba\fastjson\1.2.22\fastjson-1.2.22.jar,\D:\java\maven\maven_store\ log4j\log4j\1.2.17\log4j-1.2.17.jar,D:\java\maven\maven_store\org\slf4j\slf4j-api\1.7.18\slf4j-api-1.7.18.jar,D:\java\maven\maven_store\org\slf4j\slf4j-api\1.7.18.jar store\org\slf4j\slf4j-log4j12\1.7.18\slf4j-log4j12-1.7.18.jar,D:\java\maven\maven_store\org\codehaus\jackson\jackson-mapper-asl\ 1.9.13\jackson-mapper-asl-1.9.13.jar,D:\java\maven\maven_store\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9. 13.jar,D:\java\maven\maven_store\com\fasterxml\jackson\core\jackson-core\2.8.0\jackson-core-2.8.0.jar,D:\java\maven\maven_store\ com\fasterxml\jackson\core\jackson-databind\2.8.0\jackson-databind-2.8.0.jar,D:\java\maven\maven_store\com\fasterxml\jackson\core\ jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar,D:\java\maven\maven_store\commons-fileupload\commo

理由を教えてください。

パッケージング時にWEB-INF/フォルダにweb.xmlファイルが見つかりませんでした。

回避策

WEB-INF/web.xml ファイルが存在する場合は、pom.xml ファイルに <build> ノードに、maven-war-pluginのプラグイン設定を追加します。

org.apache.maven.plugins  
        
maven-war-plugin  
        
3.0.0  
        
WebContent  
                  
              
          
      
  

WebContent/WEB-INF/web.xml ファイルが存在しない場合、以下のように設定します。

org.apache.maven.plugins  
        
maven-war-plugin  
        
3.0.0  
        
false