我将META-INF放在Eclipse中 [英] Where do I put META-INF in Eclipse?

查看:304
本文介绍了我将META-INF放在Eclipse中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kundera教程: https: //github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes 。当我在项目根目录下创建一个文件夹META-INF并在其中放置persistence.xml时,Eclipse没有找到它。

I'm using the Kundera tutorial at https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes. Eclipse does not find it when I create a folder META-INF at the project root and place persistence.xml in it.

我做了一个快速搜索,没有真正的解决方案发布。

I did a quick search and there was no real solution posted.

没有一个有效的原因,为什么一个简单的文件路径应该难以配置。我正在寻找一个简单的答案应该是一个简单的问题。

There is no valid reason why a simple file path should be difficult to configure. I'm looking for a simple answer to what should be a simple issue.

推荐答案

不应该在项目根目录,但直接在源文件夹下。

It shouldn't be at the project root, but directly under the source folder.

在运行时,在classpath中,在META-INF下搜索persistence.xml文件。因此,如果要将META-INF文件夹放在编译包树的顶部,则需要将其放在源代码树的顶部。 Eclipse将每个非Java文件复制到其输出目录(默认为bin),遵循包/文件夹层次结构。

At runtime, the persistence.xml file is searched in the classpath, under META-INF. So if you want the META-INF folder to be put at the top of the compiled package tree, you need to put it at the top of the source tree. Eclipse copies every non-Java file to its output directory (bin, by default), respecting the package/folder hierarchy.

这篇关于我将META-INF放在Eclipse中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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