如何开始一个新项目

发布于 2024-11-15 03:46:20 字数 872 浏览 10 评论 0原文

我有史以来第一次有机会开始一个新项目。

我对项目的“开发”结构感到满意。它有常见的“src”、“lib”、“resources”、“test”等目录。我在 Eclipse 项目中已经有了这个结构。

我无法决定源代码管理中的目录结构应该是什么。我目前正在考虑以下问题:

/sourcecontrol/branch/MyProject:
-dev
---- Here I will have dirs that make up the 'Eclipse' project.
-dbscripts
---- sql Scripts for any DB Schema change
-documentation
---- UserGuide.pdf
---- DeveloperGuide.pdf
---- Other such docs
-sh
---- Here I will have the scripts to deploy, start, and stop the web server.
-notes
---- Here I will store random 'helpful notes' that developers can create for other developers. 

这个想法是,当有人只想“开发”项目时,他们只能查看“dev”目录。

这是个好主意吗?根据您过去的经验有什么建议吗?我一直无法找到不谈论“src”、“test”、“lib”等的新项目的“最佳实践”。

编辑: 如果有帮助,它是一个 java spring+hibernate webapp

编辑2:这是我现在关心的问题: Eclipse 项目结构也应该是 Source counterl 中的项目结构吗?如果是这样,那么 Eclipse 项目的基本目录也将成为源代码控制项目的基本目录

For the first time ever I am getting the chance to start a new project.

I am comfortable with structure of the project with regards to the 'development'. It has the usual 'src', 'lib', 'resources', 'test', etc dirs. I already have this structure in the Eclipse project.

I am unable to decide what should be the dir structure in the source control. I am currently thinking the following:

/sourcecontrol/branch/MyProject:
-dev
---- Here I will have dirs that make up the 'Eclipse' project.
-dbscripts
---- sql Scripts for any DB Schema change
-documentation
---- UserGuide.pdf
---- DeveloperGuide.pdf
---- Other such docs
-sh
---- Here I will have the scripts to deploy, start, and stop the web server.
-notes
---- Here I will store random 'helpful notes' that developers can create for other developers. 

The idea is that when somebody wants to just 'develop' the project, they can check out only the 'dev' dir.

Is this a good idea? Any suggestions from your past experience? I have been unable to find 'best practices' for a new project that don't talk about 'src', 'test', 'lib', etc.

EDIT:
If it helps, its a java spring+hibernate webapp

EDIT2: This is my concern as of now:
Should the Eclipse project structure be the project structure in Source countrol too? If so, then the base dir of the Eclipse project, will become the base dir of the source control project too

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

星軌x 2024-11-22 03:46:20

一些注意事项:

  • 避免检查 IDE 配置。
  • 对源代码使用 Maven 风格布局(src/main/javasrc/test/java
  • SQL 也可以以类似的风格组织,即 src/main /sql
  • 根据项目的复杂性,考虑为 API、实现、SQL、安装程序等使用单独的模块(jar)。Maven 内置了对多模块项目的支持:

A few notes:

  • Avoid checking in IDE config.
  • Use Maven style layout for source code (src/main/java, src/test/java)
  • SQL can also be organised in a similar style i.e. src/main/sql.
  • Depending on the complexity of the project consider separate modules (jars) for API, implementation, SQL, installer etc. Maven has built in support for multi-module projects:
2024-11-22 03:46:20

如果您没有找到不涉及 src、test 和 lib 目录的最佳实践,则应该暗示创建它们是通常例外的最佳实践。我想,你可以在你的 dev 目录下创建它们。

If you didn't find best practices that don't talk about src, test and lib directories, it should have been a hint that creating them was the commonly excepted best practice. I guess, you can create them under your dev directory.

温馨耳语 2024-11-22 03:46:20

请注意,大多数 Java IDE(Eclipse/IntelliJ/Netbeans)都支持 Maven。此外,teher 是用于启动和停止大多数 Web 服务器的 Maven 插件。

最简单的入门方法是

第 1 步:下载并配置 Maven。 (Netbeans 7.0 附带内置的 Maven 支持

)请阅读 http://www.ibm.com/developerworks/java 上的 AppFuse /library/j-appfuse/

步骤3。在 AppFuse 中查找并使用适合您的项目的 AppFuse arcehtype。

Please note that most Java IDsE ( Eclipse / IntelliJ / Netbeans) support Maven . Also, teher are maven plugins for starting and stopping most Webservers.

The simplest way for you to get started would be to

Step 1. Download and configure Maven . (Netbeans 7.0 ships with Maven support built in)

Step2 . Read up on AppFuse at http://www.ibm.com/developerworks/java/library/j-appfuse/

Step3. Find and use the appropriate AppFuse arcehtype for your project at AppFuse.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文