Git Product home page Git Product logo

qwz-spring-framework's Introduction

SpringFramework-5.3.x 源码构建

一、GitHub 下载源码

源码地址: https://github.com/spring-projects/spring-framework.git

二、下载 Gradle(可选)

参考:https://www.qinweizhao.com/?p=25

三、导入 IntelliJ IDEA

预编译 spring-oxm。进入项目路径,执行以下命令编译命令:

gradlew :spring-oxm:compileTestJava

四、测试

创建 qwz-spring-test 模块

package com.qinweizhao.test.first.bean;

import org.springframework.stereotype.Component;

/**
 * @author qinweizhao
 * @since 2022/3/17
 */
@Component
public class TestBean {

    public void test() {
        System.out.println("test 方法执行。。。");
    }
}
package com.qinweizhao.test.first.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author qinweizhao
 * @since 2022/3/17
 */
@Configuration
@ComponentScan("com.qinweizhao.test.**")
public class ContextConfig {
}
package com.qinweizhao.test;

import com.qinweizhao.test.first.bean.TestBean;
import com.qinweizhao.test.first.config.ContextConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author qinweizhao
 * @since 2022/3/17
 */
public class TestMain {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ContextConfig.class);
        TestBean testBean = (TestBean) context.getBean("testBean");
        testBean.test();

    }
}
plugins {
    id 'java'
}

group 'com.qinweizhao'
version '5.3.17-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation(project(":spring-context"))
    implementation(project(":spring-instrument"))
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}

test {
    useJUnitPlatform()
}

结果

test 方法执行。。。

qwz-spring-framework's People

Contributors

qinweizhao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.