There are two Gradle projects - lib and project. Project depends on lib (lib is going to jar and publish to the repository). The goal is to run the project with the tightened jar-nick lib, and if necessary it should be possible to build a composite gradle build in the IntelliJ IDEA environment. Problem - the project is successfully launched with the lib-tightened jar-nickname, but the composite build does not work - if there is no jar, then the IDE just swears that the library is not found, although the lib project is connected. It is known that IDEA is able to automatically use the included project (without using jar), even without includeBuild '../projectName' in settings.gradle, BUT even if you specify this, the included assembly is still not used. What could be the problem that I missed?
Lib project structure:
lib_project_from_git -src -main -java - ru.testcompany.test.lib - packageone - packagetwo - packagethree - resources Structure of the build.gradle lib project:
apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'idea' repositories { mavenLocal() mavenCentral() } version = "0.1" compileJava.options.encoding = "UTF-8" compileTestJava.options.encoding = "UTF-8" def logbackVersion = "1.1.8" dependencies { compile "ch.qos.logback:logback-core:${logbackVersion}" compile "ch.qos.logback:logback-classic:${logbackVersion}" } publishing { repositories { maven { name 'company' url "http://justUrl" } credentials { username "$mavenUser" password "$mavenPassword" } } } publications { lib(MavenPublication) { ext.repo = 'company' artifactId 'lib' groupId 'ru.testcompany.test.lib' from components.java } } } jar { baseName = 'lib' manifest { attributes("Version": version, "Build-By": System.getProperty("user.name"), "Build-Time-UTC": new Date().format("yyyy-MM-dd HH:mm:ssZ"), "Built-JDK": System.getProperty("java.version"), "Built-Host": InetAddress.getLocalHost().getCanonicalHostName(), "Source-Compatibility": project.sourceCompatibility, "Target-Compatibility": project.targetCompatibility) } } Part of the build.gradle project project structure:
repositories { maven { url "http://justurl" } mavenLocal() } def logbackVersion = "1.1.7" def junitVersion = "4.12" def libVersion= "0.3" dependencies { testCompile "ch.qos.logback:logback-core:${logbackVersion}" testCompile "ch.qos.logback:logback-classic:${logbackVersion}" testCompile "junit:junit:${junitVersion}" testCompile "ru.testcompany.test:lib:${libVersion}" } project settings.gradle project:
rootProject.name = 'project_from_git' // напрямую включать проект тоже не работает // includeBuild '../lib_project_from_git' The project project_from_git in IDEA is open as the main project, the project lib_project_from_git is connected via the "Atache Gradle Project" tab of the grad, and then a check mark is placed in the project_from_git project in the "Composite Build Configuratuion" menu opposite the project lib_project_from_git.
IDEA Version 2018.1
Version Gralde - 3.5
There are similar projects like this, and there the composite build works correctly.
PS The presented project names are a substitute for real names with more general ones, due to confidentiality.