简体   繁体   English

如何在Eclipse中组织gae项目

[英]How to organize gae projects in eclipse

I try to find the way to organize a GAE with several projects within Eclipse using the Google plugin for GAE: 我尝试找到使用Google GAE插件在Eclipse中组织多个项目的方法:

  • The Web App project (a WebApp project) containing the GAE web application. 包含GAE Web应用程序的Web App项目(WebApp项目)。
  • A Java project with data access 具有数据访问权限的Java项目
  • A Java project with utility classes 具有实用程序类的Java项目

My problem here is how to link things together. 我的问题是如何将事物链接在一起。 I want to add the two Java projects in both build and execution paths. 我想在构建和执行路径中都添加两个Java项目。 Since a Web App project follows the JavaEE structure, only what is specified in the WEB-INF/lib directory is taken into account. 由于Web App项目遵循JavaEE结构,因此仅考虑WEB-INF / lib目录中指定的内容。

I would like to find out how to simulate a Jar file in this directory based on a Java project present in the Eclipse workspace based on what the Google Eclipse plugin for GAE provides. 我想了解如何根据GAE的Google Eclipse插件提供的Eclipse工作区中存在的Java项目,在此目录中模拟Jar文件。

I saw something that seems to be related in the WebApp project properties Google > Web Application, section "Suppress warnings about these build path entries being outside of WEB-INF/lib". 我在WebApp项目属性Google> Web应用程序中的“抑制有关这些构建路径条目位于WEB-INF / lib之外的警告”部分中看到了一些相关的内容。

For the GAE web application to run then you'll need the classes or a jar from the projects you want to include in the WEB-INF/classes or WEB-INF/lib folders respectively. 为了使GAE Web应用程序运行,您将需要分别包含在WEB-INF / classes或WEB-INF / lib文件夹中的项目中的类或jar。

  • One way would be to build your data and utility projects and put the resulting jars in the WEB-INF/lib folder. 一种方法是构建数据和实用程序项目,并将生成的jar放入WEB-INF / lib文件夹中。 You can then then reference those jars as libraries from your web app and all should be fine. 然后,您可以从Web应用程序中将这些jar引用为库,并且一切都很好。 Of course that's a bit tiresome to do manually, so you should probably check out some dependency management tools. 当然,手动进行此操作有些麻烦,因此您可能应该检查一些依赖管理工具。 From personal experience Ivy and IvyDE were easy to get into and should cover your needs although Maven and others have their strengths. 从个人经验来看,Ivy和IvyDE很容易接触,并且可以满足您的需求,尽管Maven和其他人都有自己的长处。
  • Another way that is a easier (but less structured) is to used linked source folders in your build path (to the source folders for your data and utility projects). 另一种更容易(但结构较简单)的方法是在构建路径中使用链接的源文件夹(到数据和实用程序项目的源文件夹)。 In such way Eclipse will build those sub projects to WEB-INF/classes and build and execution should work similarly. Eclipse将以这种方式将那些子项目构建为WEB-INF / class,并且构建和执行应类似地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM