zoukankan      html  css  js  c++  java
  • 1.3使用marven Spring项目快速搭建

    自己开发了一个股票智能分析软件,功能很强大,需要的点击下面的链接获取:

    https://www.cnblogs.com/bclshuai/p/11380657.html

    1.3  Spring项目快速搭建

    (1)marven介绍

    marven是软件项目管理工具,可以方便的创建项目,管理依赖关系,自动从远程仓库下载依赖包到本地仓库m2文件夹中。

    (2)dependency三要素

    通过pom.xml文件配置依赖的jar包,会自动根据配置文件下载。依赖三要素

    1)   groupId:组织标识

    2)   artifactId:项目标识;

    3)   version版本号;

    <dependency>
             <groupId>com.hikvision.pbg.jc.ishelf</groupId>
             <artifactId>ishelf-web-business</artifactId>
             <version>${ishelf-web-business-version}</version>
          </dependency>

    (2)<properities>定义属性

    例如定义一个版本号,然后在version中使用${proname}来引用属性。

    <properties>
    <ishelf-web-business-version>2.0.0-SNAPSHOT</ishelf-web-business-version>
    </properties>

    pom.xml实例

    <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>

       <parent>
          <groupId>com.hikvision.pbg.jc.ishelf</groupId>
          <artifactId>modules</artifactId>
          <version>2.0.0-SNAPSHOT</version>
       </parent>
      
       <artifactId>ishelf-web-provider</artifactId>
       <packaging>jar</packaging>
        <properties>
    <ishelf-web-business-version>2.0.0-SNAPSHOT</ishelf-web-business-version>
    </properties>

       <dependencies>
          <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
          </dependency>
          <!-- 本服务的api接口包 -->
          <dependency>
             <groupId>com.hikvision.pbg.jc.ishelf</groupId>
             <artifactId>ishelf-web-external-api</artifactId>
             <version>2.0.0-SNAPSHOT</version>
          </dependency>
          <dependency>
             <groupId>com.hikvision.pbg.jc.ishelf</groupId>
             <artifactId>ishelf-web-business</artifactId>
             <version>${ishelf-web-business-version}</version>
          </dependency>
          <dependency>
             <groupId>com.hikvision.ga.common</groupId>
             <artifactId>hik-ga-boot-resteasy</artifactId>
          </dependency>
       </dependencies>

    </project>
  • 相关阅读:
    Spring基础知识
    Hibernate基础知识
    Struts2基础知识
    在eclipse里头用checkstyle检查项目出现 File contains tab characters (this is the first instance)原因
    java后台获取cookie里面值得方法
    ckplayer 中的style.swf 中的 style.xml 中的修改方法
    java hql case when 的用法
    Windows下Mongodb安装及配置
    Mongodb中经常出现的错误(汇总)child process failed, exited with error number
    Mac 安装mongodb
  • 原文地址:https://www.cnblogs.com/bclshuai/p/13096114.html
Copyright © 2011-2022 走看看