eclipse 父项目必须有 POM 的打包类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33729741/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The parent project must have a packaging type of POM
提问by chom
回答by Khan
Update your parent project's pom.xmlby replacing packaging property from jar/war
to pom
as following...
更新您的父项目的pom.xml,将包装属性从jar/war
to替换pom
为如下...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>project-group</groupId>
<artifactId>webservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>project-name</name>
<url>http://maven.apache.org</url>
</project>
回答by Vinit Bhardwaj
Open POM.xml in eclipse Id->Overview->ArtifactId->Packaging(Select POM from dropdown)->Save then create new Maven module.
在 eclipse Id->Overview->ArtifactId->Packaging(从下拉列表中选择 POM)->Save 中打开 POM.xml 然后创建新的 Maven 模块。
回答by AMAR KUMAR
Change:
改变:
<packaging>[here you change][1]xml<packaging>
To:
到:
<packaging>pom<packaging>
Then save the file and then right click on Project Maven > Update project
and then launch your application.
然后保存文件,然后右键单击Project Maven > Update project
并启动您的应用程序。