将其他Java文件添加到playframework类路径 [英] Adding additional java files to playframework classpath

查看:84
本文介绍了将其他Java文件添加到playframework类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与我的android项目共享模型的项目.我有一个单独的Eclipse项目,仅用于模型和其他共享代码.我将此作为eclipse中的依赖项添加到我的游戏项目中.

I have a project that shares models with my android project. I have a separate eclipse project just for models and other shared code. I add this to my play project as a dependency in eclipse.

在日食中,播放会编译并开始而不会出现问题.但是,我去了GAE,发现play打包的编译阶段失败了,因为找不到模型.

In eclipse, play compiles and starts without problem. However, I went to deploy to GAE and found that the compilation stage of play's packaging fails because it can't find the models.

我怀疑我可以破解蚂蚁的构建文件,但这似乎很脆弱.

I suspect I could hack the ant build files, but that seems brittle.

是否存在将额外目录添加到播放编译源树或类路径的标准方法?

Is there a standard way to add extra directories to the play compilation source tree or the classpath?

推荐答案

使用您的类制作一个jar文件,并将其放在/lib中.那是我放库的地方.

Make a jar-file with your classes and put it in /lib. That's where I put my libraries.

应用程序/lib文件夹中的文件由Play Framework自动添加到类路径中.请参见类路径设置

Files in the application /lib folder is automatically added to the class path by Play Framework. See Classpath settings

这篇关于将其他Java文件添加到playframework类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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