在maven中处理Web项目的非常规源目录 [英] Handling unconventional source directory for a web project in maven

查看:182
本文介绍了在maven中处理Web项目的非常规源目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个目前在eclipse中构建的Web项目(Servlets)。

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

我想在它周围添加maven。但该项目的源目录不遵循maven约定。它不是在src / main / java里面,而是src / package / name /...

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/...

我现在不想改变任何东西因为他们正在工作全速迈向里程碑。我可以配置maven接受src /作为java源目录吗?谢谢

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

推荐答案

只需在 build 部分将其添加到您的pom中。

Just add this to your pom in the build section.

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

以下是关于配置目录

这篇关于在maven中处理Web项目的非常规源目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆