Maven GWT插件添加其他源目录 [英] Maven GWT plugin adding other source directories

查看:95
本文介绍了Maven GWT插件添加其他源目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将另一个源目录添加到maven gwt编译插件?我有一些生成的代码需要在编译时加入。

How do I add another source directory to the maven gwt compile plugin? I have some generated code that I need to include in the compile.

如果我不能,人们建议怎么解决这个问题?

If I can't, what do people suggest to get around this?

推荐答案

我不知道你是否看过这个,但你可以使用 compileSourcesArtifacts 属性将生成的代码包含为外部库。有一篇关于在 GWT插件文档中设置的文章。但是,只有当您不需要将外部代码包含在您的Web应用程序中时才能使用。

I don't know if you have looked into this, but you could use the compileSourcesArtifacts attribute to include your generated code as an external library. There is an article on setting this up in the GWT Plugin Documentation. However, this will only work if you don't need the external code to be included with your web app.

过去,当我们需要这样做时,我们使用 maven-resources-plugin的复制资源目标将源代码复制到我们的主包结构中,并配置 maven-clean-plugin删除文件。因为gwt编译发生在 prepare-package 阶段-lifecycle.html#Lifecycle_Referencerel =nofollow>构建生命周期,您需要将源文件复制到目录之前(我们将其限制为 process-classes )。

Whenever we needed to do this in the past, we used the maven-resources-plugin's copy-resources goal to copy the source code into our main package structure, and configured the maven-clean-plugin to remove the files. Because the gwt compile happens during the prepare-package phase of the build lifecycle, you would need to copy your source files into the directory before that (we bound ours to process-classes).

这篇关于Maven GWT插件添加其他源目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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