coderWang1992 2016-06-04 00:57 采纳率: 0%
浏览 2085

用maven打war包时报了如下错误,大神们帮忙看看

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.0.2:war (default-war) on project shop: A type incompatibility occured while executing org.apache.maven.plugins:maven-war-plugin:2.0.2:war: org.apache.maven.project.MavenProject cannot be cast to java.lang.String
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.0.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/maven/mvnRespo/org/apache/maven/plugins/maven-war-plugin/2.0.2/maven-war-plugin-2.0.2.jar
[ERROR] urls[1] = file:/D:/maven/mvnRespo/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
[ERROR] urls[2] = file:/D:/maven/mvnRespo/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[3] = file:/D:/maven/mvnRespo/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[4] = file:/D:/maven/mvnRespo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [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/PluginExecutionException
pom 配置如下

             <plugin>   
              <groupId>org.apache.maven.plugins</groupId>   
              <artifactId>maven-war-plugin</artifactId>   
              <version>2.0.2</version> 
              <configuration> 
                 <webResources>  
                    <resource>  
                        <directory>src/main/webapp/WEB-INF</directory>  
                        <filtering>true</filtering>  
                        <targetPath>target</targetPath>  
                    </resource>  
                </webResources> 
              </configuration>   
           </plugin>
  • 写回答

1条回答

  • coderWang1992 2016-06-04 01:07
    关注

    maven 配置如下



    org.apache.maven.plugins

    maven-war-plugin

    2.0.2





    src/main/webapp/WEB-INF

    true

    target






    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!