简体   繁体   English

使用Maven创建具有Spring持久性的Java项目?

[英]To create Java project with Spring persistence using Maven?

Is it good idea to create Java project with Spring persistence using Maven? 使用Maven使用Spring持久性创建Java项目是个好主意吗?

What maven archetype to use? 使用哪种Maven原型? AppFuse is seemed to be freezed. AppFuse似乎被冻结。

The principle of a Maven archetype is to create a skeleton of an application based on some specificities (for example the usage of Spring in your case). Maven原型的原理是基于某些特殊性(例如,在您的情况下使用Spring )创建应用程序的框架。

This skeleton will generate the root pom.xml , the basic directories structure ( src/main/resources , src/main/java , and so on), as well as some other files, which are specific to the archetype used, such as the applicationContext.xml in the Spring case. 该框架将生成根pom.xml ,基本目录结构( src/main/resourcessrc/main/java等),以及一些其他特定于所用原型的文件,例如在Spring案例中为applicationContext.xml

Of course, this is only a skeleton (which is however generally runnable to get some Hello World stuff), so you will have to adapt it to your precise requirements: change the pom.xml content (for example the versions of third libraries), add or remove some configuration files... 当然,这只是一个框架(不过通常可以运行以获取一些Hello World东西),因此您将不得不对其进行调整以适应您的确切要求:更改pom.xml内容(例如,第三个库的版本),添加或删除一些配置文件...

Maybe you can give a try to any AppFuse archetype (what do you mean by freezed by the way?), and then remove everything that is not needed in your case. 也许您可以尝试使用任何AppFuse原型(顺便说一句冻结是什么意思?),然后删除您的案例中不需要的所有内容。

您可以使用Spring ROO创建基于Maven的Spring项目。

If you r using Netbeans 6.8 then follow below one 如果您使用Netbeans 6.8,请遵循以下一项

New Project->Maven->Maven PRoject->Default Archetype Catalog-> A simple J2EE Java application 新建项目-> Maven-> Maven PRoject->默认原型目录->一个简单的J2EE Java应用程序

Remove Other unused modules and modify it as per ur requirement... 删除其他未使用的模块,然后根据您的要求进行修改...

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

相关问题 如何使用Maven创建Spring项目 - How to create Spring Project using Maven 是否可以使用 java 12 创建 spring boot maven 项目? - Is it possible to create spring boot maven project with java 12? 在 JavaEE Maven 项目中使用 Hibernate 时出现“java.lang.NoClassDefFoundError: javax/persistence/criteria/Selection”错误 - "java.lang.NoClassDefFoundError: javax/persistence/criteria/Selection" error while using Hibernate in a JavaEE Maven project 在Maven Spring项目中将不同的属性文件加载到persistence.xml中 - Loading different properties files into persistence.xml in a maven spring project 试图用maven创建spring项目 - Trying to create spring project with maven 使用sqlite3寻找Java持久性api的Maven示例项目 - Looking for an maven sample project for java persistence api with sqlite3 无法使用maven用java和scala编译spring boot项目 - Unable to compile spring boot project with java and scala using maven 在Roo项目中使用javax.persistence.Table @Table批注,如何使用Maven(或Spring)从构建配置文件设置架构? - Using javax.persistence.Table @Table annotation in roo project, how can I use maven (or spring) to set the schema from a build profile? 使用Java持久性API进行Spring Hibernate集成? - Spring Hibernate integration using java persistence API? 创建一个可执行的Java Maven项目 - Create a executable java maven project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM