采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
比如app模块依赖common模块
app的build.gradle中 依赖加了
开发,idea中运行没问题,
可打包app模块时却报找不到common中的类,是不是少了什么步骤
就在 app模块中 dependencies 中添加了
compile project(':common')
以下是构建脚本
根模块:
根模块的settings.gradle
rootProject.name = 'module_gradle' include 'common' include 'app1' include 'app2'
app1模块:
group 'com._24foru' version '0.0.1-SNAPSHOT' dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile project(':common') } common }
模块: (就只有版本信息)
group 'com._24foru'
version '0.0.1-SNAPSHOT'
你的依赖怎么写的?构建脚本贴一下
就在 app模块中 dependencies 中添加了 compile project(':common') 以下是构建脚本 根模块: group = 'com._24foru' version = '0.0.1-SNAPSHOT' subprojects{ apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'war' sourceCompatibility = 1.8 repositories { mavenLocal() mavenCentral() } dependencies { compileOnly('org.projectlombok:lombok') testCompile('org.springframework.boot:spring-boot-starter-test') } } 根模块的settings.gradle rootProject.name = 'module_gradle' include 'common' include 'app1' include 'app2' app模块: group 'com._24foru' version '0.0.1-SNAPSHOT' dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile project(':common') } common 模块: (就只有版本信息) group 'com._24foru' version '0.0.1-SNAPSHOT'
就在 app模块中 dependencies 中添加了 compile project(':common') 以下是构建脚本 根模块: group = 'com._24foru' version = '0.0.1-SNAPSHOT' subprojects{ apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'war' sourceCompatibility = 1.8 repositories { mavenLocal() mavenCentral() } dependencies { compileOnly('org.projectlombok:lombok') testCompile('org.springframework.boot:spring-boot-starter-test') } } 根模块的settings.gradle rootProject.name = 'module_gradle' include 'common' include 'app1' include 'app2' app1模块: group 'com._24foru' version '0.0.1-SNAPSHOT' dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile project(':common') } common 模块: (就只有版本信息) group 'com._24foru' version '0.0.1-SNAPSHOT'
辛苦换好行怎么一回复又变成一行
登录后可查看更多问答,登录/注册
SpringBoot整合技术栈,带你跨入互联网金融的“高薪地带”
2.2k 31
1.3k 20
862 15
1.0k 11
2.4k 11