- 浏览: 686201 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (254)
- java分布式应用架构 (22)
- SSH框架整合 (6)
- java web 学习笔记 (49)
- java 学习笔记 (56)
- struts 2 学习 (6)
- Hibernate学习 (10)
- spring 学习 (2)
- 客户端编程(javascript) (4)
- IDE使用 (13)
- 生命 人生 (6)
- 系统维护 (3)
- 技术篇 (10)
- MySql (2)
- J2ME (1)
- java网络编程 (4)
- 数据库 (5)
- C/C++ (8)
- Oracle (7)
- 软件测试 (0)
- 软件的安装和部署 (0)
- Java快讯 (1)
- swt (1)
- Flex (1)
- 软件工程 (1)
- PostgreSQL (1)
- sql server2000 (2)
- 嵌入式数据库sqlite (5)
- J2EE (1)
- XML (1)
- ibatis3(MyBatis) (6)
- Linux&Unix (1)
- velocity (1)
- 回报社会 (4)
- 软件项目管理 (3)
- android研究 (3)
- C# (2)
- Objective-C (1)
- 音乐 (0)
- webx (1)
- JMS (1)
- maven软件项目管理 (1)
- 分布式服务 (0)
- 云平台 (0)
- 分布式存储 (1)
- 分布式系统架构 (0)
- 移动互联网 (1)
- ZooKeeper (1)
最新评论
-
liyys:
楼主,可不可以发这个项目的源码工程出来分享一下,少了几个类。楼 ...
仿照Hibernate实现一个SQLite的ORM框架 -
liyys:
少了一些类的源码没有粘贴出来
仿照Hibernate实现一个SQLite的ORM框架 -
honglei0412:
我使用的是这种方式获取db文件的目录但是 URL p = Fi ...
使用sqlite注意事项 -
honglei0412:
大侠 能不能说明下DbFile您是怎么做的吗?
使用sqlite注意事项 -
ahack:
刚写完mapping才发现早就有人写好了。仔细一看还都是针对的 ...
仿照Hibernate实现一个SQLite的ORM框架
引入spring框架
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>laurel</groupId> <artifactId>laurel</artifactId> <packaging>jar</packaging> <version>1.0.0-SNAPSHOT</version> <name>Started with Laurel</name> <properties> <!-- Spring version --> <version.spring>3.1.0.RELEASE</version.spring> <version.servlet>2.5</version.servlet> <!-- Spring Third Party dependencies --> <version.aopalliance>1.0</version.aopalliance> <!-- Third Party dependencies --> <version.standard.taglibs>1.1.2</version.standard.taglibs> <version.commons.logging>1.1.1</version.commons.logging> <!-- JBoss AS plugin for deployment --> <version.jboss.as.maven.plugin>7.0.2.Final</version.jboss.as.maven.plugin> </properties> <dependencyManagement> <dependencies> <!-- Define the version of JBoss' Java EE 6 APIs we want to import. Any dependencies from org.jboss.spec will have their version defined by this BOM --> <!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection) of artifacts. We use this here so that we always get the correct versions of artifacts. Here we use the jboss-javaee-web-6.0 stack (you can read this as the JBoss stack of the Java EE Web Profile 6 APIs), and we use version 2.0.0.Beta1 which is the latest release of the stack. You can actually use this stack with any version of JBoss AS that implements Java EE 6, not just JBoss AS 7! --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>3.0.0.Beta1</version> <type>pom</type> <scope>import</scope> </dependency> <!-- servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${version.servlet}</version> <scope>provided</scope> </dependency> <!-- Spring dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-mock</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-parent</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${version.spring}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${version.spring}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${version.spring}</version> </dependency> <!-- Third Party dependencies --> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>${version.aopalliance}</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>${version.standard.taglibs}</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>${version.commons.logging}</version> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Import the JPA API using the provided scope It is included in JBoss AS 7 / EAP 6 --> <dependency> <groupId>org.hibernate.javax.persistence</groupId> <artifactId>hibernate-jpa-2.0-api</artifactId> <scope>provided</scope> </dependency> <!-- servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </dependency> <!-- Import Spring dependencies, these are either from community or versions certified in WFK2 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-mock</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-parent</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <!-- Other community dependencies --> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> </dependencies> <build> <finalName>laurel</finalName> <plugins> <!-- Force Java 6 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- Deployent on AS from console --> <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>${version.jboss.as.maven.plugin}</version> </plugin> <!-- Surefire plugin before 2.9 version is buggy --> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.9</version> </plugin> </plugins> </build> </project>
<!-- Shared version number properties --> <properties> <org.springframework.version>3.0.5.RELEASE</org.springframework.version> </properties> <!-- Core utilities used by other modules. Define this if you use Spring Utility APIs (org.springframework.core.*/org.springframework.util.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Expression Language (depends on spring-core) Define this if you use Spring Expression APIs (org.springframework.expression.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Bean Factory and JavaBeans utilities (depends on spring-core) Define this if you use Spring Bean APIs (org.springframework.beans.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Aspect Oriented Programming (AOP) Framework (depends on spring-core, spring-beans) Define this if you use Spring AOP APIs (org.springframework.aop.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Application Context (depends on spring-core, spring-expression, spring-aop, spring-beans) This is the central artifact for Spring's Dependency Injection Container and is generally always defined --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Various Application Context utilities, including EhCache, JavaMail, Quartz, and Freemarker integration Define this if you need any of these integrations --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Transaction Management Abstraction (depends on spring-core, spring-beans, spring-aop, spring-context) Define this if you use Spring Transactions or DAO Exception Hierarchy (org.springframework.transaction.*/org.springframework.dao.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- JDBC Data Access Library (depends on spring-core, spring-beans, spring-context, spring-tx) Define this if you use Spring's JdbcTemplate API (org.springframework.jdbc.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-Relation-Mapping (ORM) integration with Hibernate, JPA, and iBatis. (depends on spring-core, spring-beans, spring-context, spring-tx) Define this if you need ORM (org.springframework.orm.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-XML Mapping (OXM) abstraction and integration with JAXB, JiBX, Castor, XStream, and XML Beans. (depends on spring-core, spring-beans, spring-context) Define this if you need OXM (org.springframework.oxm.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Web application development utilities applicable to both Servlet and Portlet Environments (depends on spring-core, spring-beans, spring-context) Define this if you use Spring MVC, or wish to use Struts, JSF, or another web framework with Spring (org.springframework.web.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Servlet Environments (depends on spring-core, spring-beans, spring-context, spring-web) Define this if you use Spring MVC with a Servlet Container such as Apache Tomcat (org.springframework.web.servlet.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Portlet Environments (depends on spring-core, spring-beans, spring-context, spring-web) Define this if you use Spring MVC with a Portlet Container (org.springframework.web.portlet.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Support for testing Spring applications with tools such as JUnit and TestNG This artifact is generally always defined with a 'test' scope for the integration testing framework and unit testing stubs --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${org.springframework.version}</version> <scope>test</scope> </dependency>
<repository> <id>com.springsource.repository.bundles.release</id> <name>EBR Spring Release Repository</name> <url>http:// repository.springsource.com/maven/bundles/release</url> </repository> <repository> <id>com.springsource.repository.bundles.external</id> <name>EBR External Release Repository</name> <url>http:// repository.springsource.com/maven/bundles/external</url> </repository>
<!-- Shared version number properties --> <properties> <org.springframework.version>3.0.0.RELEASE</org.springframework.version> </properties> <!-- Core utilities used by other modules. Define this if you use Spring Utility APIs (org.springframework.core.*/org.springframework.util.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.core</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Expression Language (depends on core) Define this if you use Spring Expression APIs (org.springframework.expression.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.expression</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Bean Factory and JavaBeans utilities (depends on core) Define this if you use Spring Bean APIs (org.springframework.beans.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.beans</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Aspect Oriented Programming (AOP) Framework (depends on core, beans) Define this if you use Spring AOP APIs (org.springframework.aop.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.aop</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Application Context (depends on core, expression, aop, beans) This is the central artifact for Spring's Dependency Injection Container and is generally always defined --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.context</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Various Application Context utilities, including EhCache, JavaMail, Quartz, and Freemarker integration Define this if you need any of these integrations --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.context.support</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Transaction Management Abstraction (depends on core, beans, aop, context) Define this if you use Spring Transactions or DAO Exception Hierarchy (org.springframework.transaction.*/org.springframework.dao.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.transaction</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- JDBC Data Access Library (depends on core, beans, context, transaction) Define this if you use Spring's JdbcTemplate API (org.springframework.jdbc.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.jdbc</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-Relation-Mapping (ORM) integration with Hibernate, JPA, and iBatis. (depends on core, beans, context, transaction) Define this if you need ORM (org.springframework.orm.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.orm</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-XML Mapping (OXM) abstraction and integration with JAXB, JiBX, Castor, XStream, and XML Beans. (depends on core, beans, context) Define this if you need OXM (org.springframework.oxm.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.oxm</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Web app development utilities common across Servlet/Portlet environments (depends on core, beans, context) Define this if you use Spring MVC, or wish to use Struts, JSF, or another web framework with Spring (org.springframework.web.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.web</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Servlet Environments (depends on core, beans, context, web) Define this if you use Spring MVC with a Servlet Container such as Apache Tomcat (org.springframework.web.servlet.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.web.servlet</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Portlet Environments (depends on core, beans, context, web) Define this if you use Spring MVC with a Portlet Container (org.springframework.web.portlet.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.web.portlet</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Support for testing Spring applications with tools such as JUnit and TestNG This artifact is generally always defined with a 'test' scope for the integration testing framework and unit testing stubs --> <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.test</artifactId> <version>${org.springframework.version}</version> <scope>test</scope> </dependency>
相关推荐
Java使用Maven导入Spring依赖
在Maven项目中,JUnit通常作为测试依赖引入,方便进行持续集成和持续交付。 ### Generator 自动生成相关依赖 这可能指的是代码生成工具,如MyBatis的Generator,它可以自动生成基于数据库表的模型类、Mapper接口及...
本文将深入探讨如何在Maven项目中引入依赖的包,并结合相关源码和工具,帮助开发者更好地理解和使用这一功能。 首先,理解Maven的核心概念——`pom.xml`。这是每个Maven项目的心脏,它定义了项目的配置信息,包括...
在Java开发中,Maven作为主流的构建工具,管理着项目的依赖关系。然而,当项目引入多个库时,可能会遇到依赖冲突的问题。依赖冲突通常发生在两个或更多库使用相同类的不同版本时,Maven默认会选择最高版本的依赖,但...
- **添加依赖**: 首先,需要在项目的构建文件(如Maven的pom.xml或Gradle的build.gradle)中添加Spring的相关依赖。 - **配置Servlet容器**: 如果是使用Servlet容器(如Tomcat),需要配置一个名为`...
- **添加classpath依赖**:通过在`pom.xml`中引入`spring-boot-starter-parent`作为父POM,可以方便地管理项目的依赖版本和构建配置。 ```xml <groupId>org.springframework.boot <artifactId>spring-boot-...
在这个版本中,Spring Framework与Maven集成,使得开发者能够更方便地管理项目依赖,同时也便于对源码进行学习和调试。 **1. Maven集成** Maven是Apache基金会开发的项目管理工具,它通过XML配置管理项目的依赖...
标题中的“springboot(web项目,非maven)”指的是一个基于Spring Boot框架构建的Web应用程序,但它不是使用Maven作为构建工具。Spring Boot简化了Java Web应用的开发过程,提供了快速构建可运行的应用程序的方式,而...
例如,如果我们需要在项目中使用Spring Boot的starter-web库,我们可以在dependencies部分添加如下代码: ```xml <groupId>org.springframework.boot <artifactId>spring-boot-starter-web <version>2.0.3....
在Maven的配置文件`pom.xml`中,我们可以声明所需的依赖,包括Spring Boot测试相关的库。这些依赖使得我们能够编写和运行测试类,以验证Spring Boot应用的行为。让我们详细了解一下如何添加这些测试相关的Maven依赖...
在Maven项目中,我们可以通过在POM.xml中添加Spring的相关依赖,如`spring-context`,`spring-web`等,来引入Spring框架。 创建一个简单的Spring应用通常包括以下步骤: 1. 创建Spring配置文件(如:...
在"基于Maven构建的Spring IoC源码实例"中,我们可以学到如何使用Maven搭建Spring项目,并通过Spring IoC实现组件间的依赖注入。以下是这个实例中可能包含的关键知识点: 1. **Maven项目结构**:了解标准的Maven...
本篇文章将深入探讨如何使用Maven作为构建工具,在Eclipse环境中搭建一个整合了Spring、Spring MVC和Hibernate的项目。 首先,让我们了解Maven。Maven是Apache开发的一款项目管理和综合工具,它通过一个项目对象...
在SSH Maven项目中,Maven负责整合并管理这些组件的依赖关系,通过配置pom.xml文件,可以自动化构建过程,包括编译、测试、打包、部署等步骤。 "ssh项目搭建.docx"可能是一个详细的步骤指南,指导用户如何配置和...
通过这个案例,开发者可以学习如何配置Maven的POM.xml文件,引入Spring依赖,编写Spring配置,以及如何利用Maven的生命周期进行构建和测试。这个实例对于初学者来说是一个很好的起点,能够帮助他们理解这两个强大的...
在这个项目中,Maven通过其POM(项目对象模型)文件管理项目的依赖关系,确保所有必要的库都正确引入,并提供了一套标准化的构建过程。 【运行模式】 1. **Java程序运行**:这种方式下,项目被编译为可执行的Java...
3. **配置pom.xml**:在新创建的项目中,编辑pom.xml文件,添加Struts2、Spring和iBatis的依赖。例如: ```xml <!-- Struts2 --> <groupId>org.apache.struts <artifactId>struts2-core <version>2.5.17 ...
为了使用`CommonsMultipartFile`,你需要在你的Maven项目中添加Apache Commons IO和Spring Web依赖。在你的`pom.xml`文件中添加以下依赖: ```xml <!-- Spring Web --> <groupId>org.springframework ...
不同范围的依赖会在不同的阶段被引入到类路径中。 4. **依赖解决**:Maven会自动解析并下载所有声明的依赖,包括它们的子依赖。如果有版本冲突,Maven会根据依赖管理的原则进行解决,通常遵循“最近优先”原则。 5...
在项目中,"homeproject"可能包含了整个项目的源代码、配置文件、资源文件等,你可以通过解压这个文件来查看和学习整个框架的实现细节。随着项目的更新,你可能需要关注各个组件的新特性,以便持续优化和升级项目。...