gradle無需插件配置內嵌tomcat


//1.關閉IDEA中的gradle配置: Download external annotations for dependencies
否則會去下載annotations相關包,有時會出錯

// 2. build.gradle中倉庫與依賴配置
repositories {
    maven { url 'https://maven.aliyun.com/repository/jcenter/'}
    maven { url 'https://maven.aliyun.com/repository/central/' }

    mavenCentral()
    mavenLocal()
}
dependencies {
    testImplementation 'junit:junit:4.13'

    implementation "org.apache.tomcat.embed:tomcat-embed-core:9.0.44"
    implementation "org.apache.tomcat.embed:tomcat-embed-jasper:9.0.44"
    testImplementation "org.apache.tomcat.embed:tomcat-embed-core:9.0.44"
    testImplementation "org.apache.tomcat:tomcat-util:9.0.44"
  // 實在不行可以先下載然后本地加載
  // compile fileTree(dir: 'src/main/libs', includes: ['*.jar'])
}

/** 莫名其妙必須加上版本號才行,但是有的其他依賴不加也沒問題 **/
  

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM