Handling unconventional source directory for a web project in maven

£可爱£侵袭症+ 提交于 2019-12-17 16:32:31

问题


I've inherited a web project (Servlets) which is currently build inside eclipse.

I want to add maven around it. But the project's source directory is not following the maven convention. Instead of being inside src/main/java, it's src/package/name/...

I don't want to change anything right now because they are working at full speed towards a milestone. Can I configure maven to accept src/ as the java source directory ? Thanks


回答1:


Just add this to your pom in the build section.

<sourceDirectory>${basedir}/src</sourceDirectory>

Here's the relevant section of the POM doc on configuring the directories.



来源:https://stackoverflow.com/questions/224373/handling-unconventional-source-directory-for-a-web-project-in-maven

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!