成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

Spring項(xiàng)目運(yùn)行怎么依賴spring-contex

小編這次要給大家分享的是Spring項(xiàng)目運(yùn)行怎么依賴spring-contex,文章內(nèi)容豐富,感興趣的小伙伴可以來了解一下,希望大家閱讀完這篇文章之后能夠有所收獲。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名與空間、網(wǎng)站空間、營銷軟件、網(wǎng)站建設(shè)、光山網(wǎng)站維護(hù)、網(wǎng)站推廣。

spring項(xiàng)目跑起來,只需要spring-context這1個(gè)依賴項(xiàng)就行,參考下面:

一、pom.xml

<&#63;xml version="1.0" encoding="UTF-8"&#63;>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.cnblogs.yjmyzz</groupId>
  <artifactId>spring-boot-demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <properties>
    <java.version>1.8</java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.2.4.RELEASE</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

二、示例代碼:

package com.cnblogs.yjmyzz.springbootdemo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

/**
 * @author 菩提樹下的楊過
 */
@ComponentScan("com.cnblogs.yjmyzz")
@Configuration
public class SampleApplication {

  interface SampleService {
    void helloWorld();
  }

  @Service
  class SampleServiceImpl implements SampleService {

    @Override
    public void helloWorld() {
      System.out.println("hello spring");
    }
  }

  public static void main(String[] args) {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SampleApplication.class);
    SampleService service = context.getBean(SampleService.class);
    service.helloWorld();
  }
}

項(xiàng)目結(jié)構(gòu):

Spring項(xiàng)目運(yùn)行怎么依賴spring-contex

spring-context的依賴關(guān)系如下:

Spring項(xiàng)目運(yùn)行怎么依賴spring-contex

看完這篇關(guān)于Spring項(xiàng)目運(yùn)行怎么依賴spring-contex的文章,如果覺得文章內(nèi)容寫得不錯的話,可以把它分享出去給更多人看到。

網(wǎng)站名稱:Spring項(xiàng)目運(yùn)行怎么依賴spring-contex
轉(zhuǎn)載來源:http://jinyejixie.com/article16/pdcodg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、小程序開發(fā)、企業(yè)網(wǎng)站制作、微信公眾號、網(wǎng)站建設(shè)、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管
本溪| 夹江县| 道真| 深泽县| 诏安县| 朝阳市| 荔浦县| 沂南县| 明水县| 天津市| 崇州市| 常山县| 大同市| 乃东县| 抚松县| 喀什市| 永春县| 弥渡县| 平陆县| 华容县| 新平| 太康县| 张家川| 东宁县| 当阳市| 遵义县| 财经| 喀喇沁旗| 喀喇沁旗| 东明县| 北海市| 兴山县| 老河口市| 开阳县| 来宾市| 米脂县| 湟源县| 清原| 大方县| 庆安县| 桐梓县|