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






    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog