From 35b025481e0bd4755adc0a51a87b328430c16d13 Mon Sep 17 00:00:00 2001 From: Alejandro Revilla Date: Sun, 6 Jun 2021 19:39:17 -0300 Subject: [PATCH] Use maven-publish pluging - upgrade wrapper to 6.8.2 --- build.gradle | 131 ++++++++++++++--------- gradle/wrapper/gradle-wrapper.properties | 2 +- jpos-app.gradle | 2 +- modules/build.gradle | 3 - modules/qi-core/build.gradle | 45 +------- 5 files changed, 83 insertions(+), 100 deletions(-) delete mode 100644 modules/build.gradle diff --git a/build.gradle b/build.gradle index 90d2df1173..abc55408bb 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,6 @@ buildscript { allprojects { apply plugin: 'idea' apply plugin: 'eclipse' - apply plugin: 'maven' apply plugin: 'org.owasp.dependencycheck' group = 'org.jpos.ee' @@ -22,6 +21,7 @@ allprojects { subprojects { apply plugin: 'java-library' + apply plugin: 'maven-publish' apply plugin: 'signing' sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -34,64 +34,93 @@ subprojects { project.archivesBaseName="jposee-${project.name}" javadoc.failOnError = false - def pomConfig = { - name 'jPOS-EE Project' - description """ - jPOS Extended Edition - """ - url 'http://jpos.org' - inceptionYear '1998' - organization { - name 'jPOS.org' - url 'http://jpos.org' - } - issueManagement { - system 'YouTrack' - url 'https://jpos.org/issues' - } - scm { - url "https://github.com/jpos/jPOS" - connection "scm:git:https://github.com/jpos/jPOS-EE.git" - developerConnection "scm:git:git@github.com:jpos/jPOS-EE.git" - } - licenses { - license { - name 'GNU AFFERO GENERAL PUBLIC LICENSE' - url 'http://www.gnu.org/licenses/agpl-v3.html' - comments 'See http://jpos.org/license for more details.' - distribution 'repo' + publishing { + publications { + mavenJava(MavenPublication) { + pom { + name = 'jPOS Project' + description = "jPOS Extended Edition" + url = "http://jpos.org" + organization { + name = 'jPOS.org' + url = 'http://jpos.org' + } + issueManagement { + system = 'Github Issues' + url = 'https://github.com/jpos/jPOS-EE/issues' + } + scm { + url = "http://github.com/jpos/jPOS-EE" + connection = "scm:git:https://github.com/jpos/jPOS-EE.git" + developerConnection = "scm:git:git@github.com:jpos/jPOS-EE.git" + } + licenses { + license { + name = 'GNU AFFERO GENERAL PUBLIC LICENSE' + url = 'http://www.gnu.org/licenses/agpl-v3.html' + comments = 'See http://jpos.org/license for more details.' + distribution = 'repo' + } + } + developers { + developer { + id = 'jpos-team' + name = 'jPOS Development Team' + email = 'info@jpos.org' + } + } + } + groupId = 'org.jpos.ee' + artifactId = 'jposee' + from components.java + /* + artifact (sourceJar) { + classifier = 'sources' + } + */ + artifactId="jposee-${project.name}" + +/* + pom.withXml { + asNode().dependencies.'*'.findAll() { + it.scope.text() == 'compile' && project.configurations.compile.allDependencies.find { dep -> + dep.name == it.artifactId.text() + } + }.each() { + it.scope*.value = 'implementation' + } + asNode().dependencies.'*'.findAll() { + if (it.groupId.text() == 'org.jpos.ee') { + it.artifactId*.value = "jposee-${it.artifactId.text()}" + } + } + } +*/ + } } - developers { - developer { - id 'jpos-team' - name 'jPOS Development Team' - email 'info@jpos.org' + repositories { + maven { + def releasesRepoUrl = mavenCentralRepo + def snapshotsRepoUrl = 'file:///opt/local/maven' + url = isSnapshot ? snapshotsRepoUrl : releasesRepoUrl + if (!isSnapshot) { + credentials { + if (project.hasProperty("mavenCentralUsername")) + username = mavenCentralUsername + if (project.hasProperty("mavenCentralPassword")) + password = mavenCentralPassword + } + } } } } - - configure(install.repositories.mavenInstaller) { - pom.project pomConfig - } signing { required { !isSnapshot } - sign configurations.archives - } - uploadArchives { - repositories { - mavenDeployer { - pom.project pomConfig - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: 'file:///opt/local/maven') - /* - repository(url: mavenCentralRepo) { - authentication(userName: mavenCentralUsername, password: mavenCentralPassword) - } - */ - } - } + sign publishing.publications.mavenJava } + + test { useJUnitPlatform() maxParallelForks = Runtime.runtime.availableProcessors() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de6a4..2a563242c1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jpos-app.gradle b/jpos-app.gradle index 3a8d56a7d0..4beae9d3ff 100644 --- a/jpos-app.gradle +++ b/jpos-app.gradle @@ -112,7 +112,7 @@ task version (type: JavaExec, dependsOn: classes) { description = "Shows jPOS Version" main = 'org.jpos.q2.Q2' args = ['--version'] - classpath configurations.runtime + classpath configurations.runtimeClasspath } task dist(type: Tar) { diff --git a/modules/build.gradle b/modules/build.gradle deleted file mode 100644 index 62b232f61c..0000000000 --- a/modules/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -install { - actions=[] -} diff --git a/modules/qi-core/build.gradle b/modules/qi-core/build.gradle index e4435d5b44..137ec8cef3 100644 --- a/modules/qi-core/build.gradle +++ b/modules/qi-core/build.gradle @@ -4,6 +4,7 @@ plugins { vaadin { version=vaadinVersion manageDependencies = true + manageRepositories = false } vaadinAddon { title='QI' @@ -12,49 +13,6 @@ vaadinAddon { vaadinCompile.gwtSdkFirstInClasspath=true vaadinThemeCompile.themesDirectory = "${webAppDir}/../resources/VAADIN/themes" -apply plugin: 'maven-publish' - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - artifact (sourceJar) { - classifier = 'sources' - } - artifactId="jposee-${project.name}" - pom.withXml { - asNode().dependencies.'*'.findAll() { - it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep -> - dep.name == it.artifactId.text() - } - }.each() { - it.scope*.value = 'compile' - } - asNode().dependencies.'*'.findAll() { - if (it.groupId.text() == 'org.jpos.ee') { - it.artifactId*.value = "jposee-${it.artifactId.text()}" - } - } - } - } - } - repositories { - maven { - url 'file:///opt/local/maven' - } - } -} - -install { - doFirst { - Configuration archivesConfig = project.getConfigurations().getByName('archives') - archivesConfig.artifacts.removeAll { - it.extension.equals('war') - } - } -} -uploadArchives.enabled = false - dependencies { api "com.vaadin:vaadin-server:${vaadinVersion}" api "com.vaadin:vaadin-push:${vaadinVersion}" @@ -88,6 +46,5 @@ jar { jar.dependsOn("vaadinThemeCompile") jar.dependsOn("vaadinCompile") -install.dependsOn("publishToMavenLocal") uploadArchives.dependsOn("jar", "publishMavenJavaPublicationToMavenRepository")