intellij idea gradle 瀵煎叆 spring 闂璁板綍

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了intellij idea gradle 瀵煎叆 spring 闂璁板綍相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/framework' title='framework'>framework   extension   jdk   xsd   main   鎵撳紑   image   rate   find   

鐜锛?/strong>

  windows 7

  oracle jdk 1.8

  intellij idea 2019.3.1

  spring-framework 5.1.22.RELEASE

 

姝ラ锛?/span>

1: 涓嬭浇瑙e帇spring zip 鍖?githup鎴栬€単itee涓嬭浇)

 

 

2: 淇敼spring-framework婧愮爜閰嶇疆淇℃伅

鎵撳紑椤圭洰瀛愮洰褰?>>> ./gradle

鎶€鏈浘鐗? src=

 

 

 

淇敼docs.gradle鏂囦欢 >>> dokka鏂规硶浠ュ強asciidoctor鏂规硶娉ㄩ噴

鎶€鏈浘鐗? src=

 

 

 鎶€鏈浘鐗? src=

 

娉細 

task schemaZip(type: Zip) 鍦ㄦ煇浜涚増鏈浠诲姟涓槸娌℃湁鍏煎window鐨勮矾寰勭鍙凤紝闇€瑕佹墜鍔ㄤ慨鏀逛竴涓?/pre>

鎶€鏈浘鐗? src=

 

 

 淇敼濡備笅  >>>>>>>

task schemaZip(type: Zip) {
    group = "Distribution"
    baseName = "spring-framework"
    classifier = "schema"
    description = "Builds -${classifier} archive containing all " +
            "XSDs for deployment at https://springframework.org/schema."
    duplicatesStrategy 鈥榚xclude鈥?span style="color: #000000;">
    moduleProjects.each { subproject ->
        def Properties schemas = new Properties();

        subproject.sourceSets.main.resources.find {
            (it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INFspring.schemas"))
        }?.withInputStream { schemas.load(it) }

        for (def key : schemas.keySet()) {
            def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, 鈥?1鈥?span style="color: #000000;">)
            assert shortName != key
            File xsdFile = subproject.sourceSets.main.resources.find {
                (it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll(鈥榎/鈥?鈥榎鈥?span style="color: #000000;">)))
            }
            assert xsdFile != null
            into (shortName) {
                from xsdFile.path
            }
        }
    }
}

 

 

 

鍏堢暀涓€涓潙 銆傘€傘€傘€?/p>

 

 

 

 

 

 

 

 

3.瀵煎叆椤圭洰 >>> 閫変腑build.gradle鍙抽敭import

 

婕暱鐨勭瓑寰呬腑 銆傘€傘€傘€?/span>

 

 

 

 

涓€鑸儏鍐典笅瀵煎叆鏄彲浠ユ垚鍔熺殑锛屼絾 銆傘€?/span>

exception during working with external system: java.lang.AssertionError
    at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.createModule(BaseGradleProjectResolverExtension.java:154)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.kotlin.idea.configuration.KotlinMPPGradleProjectResolver.createModule(KotlinMPPGradleProjectResolver.kt:67)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.createModule(AndroidGradleProjectResolver.java:165)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.kotlin.android.configure.KotlinAndroidMPPGradleProjectResolver.createModule(KotlinAndroidMPPGradleProjectResolver.kt:45)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.createModule(AbstractProjectResolverExtension.java:86)
    at org.jetbrains.plugins.gradle.service.project.TracedProjectResolverExtension.createModule(TracedProjectResolverExtension.java:45)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:344)
    
... ...

 

 

杩欎釜鏄洜涓簊pring閰嶇疆鐨刧radle鐗堟湰闂

鎶€鏈浘鐗? src=

 

 

 

 

鎵撳紑./gradle/wrapper/gradle-wrapper.properties鏂囦欢

淇敼涓?.x鐗堟湰锛屽崥涓讳慨鏀逛负gradle-5.5.1-all.zip //all鍖呭惈婧愮爜

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-5.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

鎴愬姛瀵煎叆灞曠ず锛?/p>

鎶€鏈浘鐗? src=

 

 

 

 

4. 缂栬瘧婧愪唬鐮?/span>

杩欓噷鍏堢湅涓€涓媠pring鐨刴arkdown鏂囨。

鎶€鏈浘鐗? src=

 

 

 澶ц嚧鎰忔€濇槸闇€瑕佸厛棰勭紪璇慲spring-core`銆乣spring-oxm`浠ュ強`spring-aspects`銆?/span>

 鍏堢洿鎺ョ紪璇慲spring-oxm`瀹冧緷璧栦簡`spring-core`

 gradle绐楀彛涓€夋嫨spring-oxm > Tasks > other > compileTestJava

鐒跺悗鏄痐spring-aspects` >>>
spring-aspects > Tasks > other > compileTestJava

濡傛灉澶辫触璇峰厛瀹夎ajc缂栬瘧鍣?nbsp;https://www.eclipse.org/aspectj/downloads.php

鎶€鏈浘鐗? src=

 

 鐐瑰嚮Test 

鎶€鏈浘鐗? src=

 

 

鍐嶇敓鎴愬嵆鍙?/p>

 

 

----------------------------------------------------------------------------------

鐩墠閬囧埌闂灏辫繖鍑犵偣锛屽笇鏈涜兘甯姪鍒板ぇ瀹躲€?/span>

以上是关于intellij idea gradle 瀵煎叆 spring 闂璁板綍的主要内容,如果未能解决你的问题,请参考以下文章

MongoDB mongoimport 浠巆sv瀵煎叆鏁版嵁鎸囧畾瀛楁绫诲瀷

odoo 瀵煎叆鏂囦欢xml鍒朵綔,浣跨敤csv 鏂囦欢鍒朵綔xml 鏂囦欢

36銆佸垱寤轰竴涓猘ctor_name琛紝灏哸ctor琛ㄤ腑鐨勬墍鏈塮irst_name浠ュ強last_name瀵煎叆鏀硅〃

intellij idea 导入gradle项目卡在 gradle: build model...

intellij idea 怎么gradle创建spring boot

导入 Gradle 项目到 IntelliJ IDEA