简体   繁体   English

没有web.xml文件的Maven-ant .war文件

[英]maven-ant .war file without web.xml file

I have a important question , I don't have a web.xml in my java project and i want to create a .war file of that project. 我有一个重要的问题,我的Java项目中没有web.xml ,我想创建该项目的.war文件。 Can i do that? 我可以那样做吗? as I have searched all over but did not found anything, can you please help me out here? 由于我到处搜索但没有找到任何东西,请您在这里帮助我吗?

I have pom.xml in the project and it has all the dependencies. 我在项目中有pom.xml ,它具有所有依赖项。

I have created a maven project and then i am using the maven-ant plugin, so, in ant, i want to create .war file . 我创建了一个maven项目,然后使用了maven-ant插件,因此在ant中,我想创建.war file

After building it through ant , I have build.xml and maven-build.xml files. 通过ant构建它之后,我有了build.xml and maven-build.xml文件。 Please help me out here! 请帮我在这里!

Thank you! 谢谢!

Check your folder project/target to certify your .war was not created 检查您的文件夹项目/目标以证明您未创建.war

Your pom.xml need have this structure after your dependencies to generate .war 您的pom.xml在依赖项生成后需要具有此结构。

<build>
 <finalName>your .war name</finalName>
</build>

您可以将ant的“ war”任务与参数needxmlfile设置为false一起使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM