This is a company plugin, hosted on maven central and is base of our all projects/sub-modules to start working with it.
A typical settings.gradle
file of base app looks like this:
pluginManagement {
repositories {
mavenCentral() {
content {
excludeGroup 'com.companyname'
}
}
maven {
url 'https://repository.companyname.com/link/to/repository/maven-public/'
}
}
plugins {
id 'com.companyname.app' version '7.1.1'
}
}
plugins {
id 'com.github.node-gradle.node' version '3.5.1' apply false
}
dependencyResolutionManagement {
repositories {
mavenCentral() {
content {
excludeGroup 'com.companyname'
}
}
maven {
url 'https://repository.companyname.com/link/to/repository/maven-public/'
}
// Declare the Node.js download repository
ivy {
name = "Node.js"
setUrl("https://nodejs.org/dist/")
patternLayout {
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
}
metadataSources {
artifact()
}
content {
includeModule("org.nodejs", "node")
}
}
}
}
//Include all modules
rootProject.name = "companyname-productname"
def modules = []
file("modules").traverse(type: groovy.io.FileType.DIRECTORIES, maxDepth: 1) { it ->
if (new File(it, "build.gradle").exists()) {
modules.add(it)
}
}
gradle.ext.appModules = modules
modules.each { dir ->
include "modules:$dir.name"
project(":modules:$dir.name").projectDir = dir
}
and a build.gradle
file of base app looks like this:
plugins {
id 'com.companyname.app'
}
companyname {
title "CompanyName ProductName"
description "CompanyName Enterprise Application"
}
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.companyname.apps'
version = '7.1.5'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
afterEvaluate {
test {
useJUnitPlatform()
beforeTest { descriptor ->
logger.lifecycle('Running: ' + descriptor)
}
}
}
configurations {
runtimeClasspath.exclude group: "org.eclipse.birt.runtime.3_7_1", module: "org.apache.commons.codec"
}
}
tasks.withType(PublishToMavenRepository).configureEach { it.enabled = false }
dependencies {
gradle.appModules.each { dir ->
implementation project(":modules:$dir.name")
}
}
and build.gradle
of any sub-module looks like this:
plugins {
id 'com.companyname.app'
}
companyname {
title "companyname :: companyname accounting"
description "companyname accounting module"
}
dependencies {
// module dependencies
api "com.companyname.apps:module-1:5.0.0"
api "com.companyname.apps:module-2:7.1.0"
}
In case of working with new cloned instance of a module, the first time build fetches the jars, but sometimes there is an issue of server timeout, due to slow server response.
I have the requires jars locally available, but no clue how to use them as it uses them as plugin instead of dependencies.
PVI-AXL is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.