座机 发表于 2015-11-13 15:30:59

关于Cannot construct org.apache.maven.plugin.war.util.WebappStructure maven打包问题解决

  今天本来打算学习下cxf,用maven创建工程打包报错
  


  


  

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
cause-exception   : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
class               : org.apache.maven.plugin.war.util.WebappStructure
required-type       : org.apache.maven.plugin.war.util.WebappStructure
path                : /webapp-structure
line number         : 1
-------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Trace
com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
cause-exception   : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
class               : org.apache.maven.plugin.war.util.WebappStructure
required-type       : org.apache.maven.plugin.war.util.WebappStructure
path                : /webapp-structure
line number         : 1
结果在stackoverflow 上提供了一个解决方案结果真见效,主要是我的插件
    <plugin>
<artifactId>maven-war-plugin</artifactId>
</plugin>

没有配版本了,结果加上<version>2.1.1</version>一下子就搞定了。我想这应该是插件版本太低了,打成war包就出了问题。原文参见http://stackoverflow.com/questions/7539970/cannot-construct-org-apache-maven-plugin-war-util-webappstructure-as-it-does-not
  

版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: 关于Cannot construct org.apache.maven.plugin.war.util.WebappStructure maven打包问题解决