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

猜你喜欢

转载自blog.csdn.net/samz5906/article/details/43450217