Closed youzhigithub closed 5 years ago
@youzhigithub B项目不要all exclude
@pkaq 没有效果,依然报错。为了防止缓存,我重新起了一个项目。 A项目的配置: B项目的配置:
a依赖b 但b要把自身排除掉 而不是全局排除
@pkaq 我现在不是在打包的时候找不到B项目的代码吗? 还需要把B项目排除? common是现在的B项目,我这样配置后去打包依然报错呀,配置不对嘛
其它可以依赖core 但core不要依赖core 循环依赖了 直接上可重现链接吧
@pkaq https://github.com/youzhigithub/springcloud-demo 老哥这是demo地址,尝试打包service-hi的时候失败
刚好我这有个sc的示例 参考一下 https://github.com/pkaq/springcloud7
这个示例没有出现项目依赖..
这个示例没有出现项目依赖..
老哥,我也出现了这个问题,请问您解决了吗?
这个示例没有出现项目依赖..
请问老哥解决这个问题了么?
今天再问一遍,老哥解决了吗
同问hh
使用Gradle多模块开发Spring cloud项目,A工程是个Springboot项目(eureka-server),B工程是个通用工具类的工程(core),A工程依赖B工程(在根项目的build.gradle中配置) ,同时在项目的settings文件中配置了依赖 ,在idea中运行正常,当将A工程打包成jar运行时提示找不到符号(A工程中使用B工程代码的地方) 。 以下为配置文件的内容: 根项目的settings.gradle: rootProject.name = 'springcloud' include 'service-feign' include 'service-hi' include 'eureka-server' include 'service-zuul' include 'core'
根项目的build.gradle: buildscript { ext{ springBootVersion = '2.0.3.RELEASE' springCloudVersion = 'Finchley.RELEASE' } repositories { maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } mavenCentral() jcenter() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } allprojects { group 'com.su.sc' version '1.0.0'
} subprojects{ apply plugin: 'io.spring.dependency-management'
}
A项目的build.gradle(eureka-server) dependencies { compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client') compile('org.springframework.boot:spring-boot-starter-web') } B项目的build.gradle(core)
dependencies {
} configurations { all*.exclude module: 'core' }
打包方式为: 1、idea中选择任务 2、到A项目跟目录使用命令行:gradle build打包