Error:Artifact 'xx.war exploded' has invalid extension


環境信息:  IDEA 13 ,  MAVEN, JBOSS 7.   

配置信息: 常規配置。

出錯信息: Error:Artifact 'xx.war exploded' has invalid extension 

原因: 出現這種錯誤的原因是 build 打的 war 包不正確造成的, 修改 pom.xml build war 包部分代碼既可。

代碼如下:

 <plugin>
       <artifactId>maven-war-plugin</artifactId>
       <configuration>
             <webappDirectory>${project.build.directory}/${project.artifactId}.${project.packaging}</webappDirectory>
             <failOnMissingWebXml>false</failOnMissingWebXml>
       </configuration>
</plugin>

 

mvn clean package ,后錯誤信息就不在了。

 

參考: stackoverflow : http://stackoverflow.com/questions/24725644/intellij-idea-artifact-xxxxwar-exploded-has-invalid-extension

Actually, you should leave the finalName attribute alone, otherwise you'll get the problems you describe. Rather, you should change the config for the maven war plugin to use the webappDirectorylike this:

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
        <webappDirectory>${project.build.directory}/${project.artifactId}.${project.packaging}</webappDirectory>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM