- Spring Essentials
- Shameer Kunjumohamed Hamidreza Sattari
- 186字
- 2021-07-16 13:05:46
Setting up the development environment
Spring projects are usually created as Java projects based in Maven, Gradle, or Ivy (which are build automation and dependency management tools). You can easily create a Maven-based Spring project using STS or Eclipse with Spring Tools support. You need to make sure your pom.xml
(Maven configuration) file contains, at the minimum, a dependency to spring-context
:
<dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring-framework.version}</version> </dependency> ... </dependencies>
Of course, you should add further dependencies to modules such as spring-tx
, spring-data-jpa
, spring-webmvc
, and hibernate
, depending on your project type and requirements.
Unless you explicitly specify the repository location, your project works with Maven's central repository. Alternatively, you can point to Spring's official Maven repository (for example, for milestones and snapshots) by specifying it in your pom.xml
file:
<repositories> <repository> <id>io.spring.repo.maven.milestone</id> <url>http://repo.spring.io/milestone/</url> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories>
You can use the Spring release
, milestone
, and snapshot
repositories as required.
If you are using Gradle as your build system, you can declare your dependencies (typically in the build.gradle
file) as follows:
dependencies { compile('org.springframework:spring-context') compile('org.springframework:spring-tx') compile('org.hibernate:hibernate-entitymanager') testCompile('junit:junit') }
If you prefer using the Ivy dependency management tool, then your Spring dependency configuration will look like this:
<dependency org="org.springframework" name="spring-core" rev="4.2.0.RC3" conf="compile->runtime"/>
- Google Flutter Mobile Development Quick Start Guide
- Hands-On Image Processing with Python
- Learning RabbitMQ
- Python王者歸來
- 從學(xué)徒到高手:汽車電路識圖、故障檢測與維修技能全圖解
- 嚴(yán)密系統(tǒng)設(shè)計:方法、趨勢與挑戰(zhàn)
- Visual FoxPro程序設(shè)計
- Jenkins Continuous Integration Cookbook(Second Edition)
- Python忍者秘籍
- jQuery炫酷應(yīng)用實例集錦
- 區(qū)塊鏈技術(shù)與應(yīng)用
- Unity Character Animation with Mecanim
- 深入分析GCC
- 從零開始學(xué)Python大數(shù)據(jù)與量化交易
- C# 7.0本質(zhì)論