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