diff --git a/build.gradle b/build.gradle index 24af4795..1ab2e990 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ plugins { id 'io.spring.dependency-management' version '1.1.3' apply false - id 'com.jfrog.artifactory' version '5.1.4' apply false id 'org.asciidoctor.jvm.pdf' version '3.3.2' id 'org.asciidoctor.jvm.gems' version '3.3.2' id 'org.asciidoctor.jvm.convert' version '3.3.2' @@ -19,6 +18,7 @@ allprojects { apply plugin: "io.spring.dependency-management" apply plugin: "org.springframework.build.optional-dependencies" apply from: "${rootProject.projectDir}/ide.gradle" + apply from: "${rootDir}/gradle/publications.gradle" dependencyManagement { imports { @@ -111,16 +111,19 @@ configure(javaProjects) { javaProject -> from javadoc } - artifacts { - archives sourcesJar - archives javadocJar + publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + } + } } } subprojects { subproject -> - apply from: "${rootDir}/gradle/publish-maven.gradle" - java { toolchain { languageVersion = JavaLanguageVersion.of(17) diff --git a/gradle/docs.gradle b/gradle/docs.gradle index f5fe5b51..74ee3341 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -1,5 +1,4 @@ apply plugin: "maven-publish" -apply plugin: "com.jfrog.artifactory" configurations { asciidoctorExtensions @@ -179,7 +178,3 @@ publishing { } } } - -artifactoryPublish { - publications(publishing.publications.mavenJava) -} \ No newline at end of file diff --git a/gradle/publications.gradle b/gradle/publications.gradle new file mode 100644 index 00000000..91076ad7 --- /dev/null +++ b/gradle/publications.gradle @@ -0,0 +1,70 @@ +apply plugin: "maven-publish" + +publishing { + publications { + mavenJava(MavenPublication) { + pom { + afterEvaluate { + name = project.description + description = project.description + } + url = "https://github.com/spring-projects/spring-webflow" + organization { + name = "Spring IO" + url = "https://spring.io/projects/spring-webflow" + } + licenses { + license { + name = "Apache License, Version 2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0" + distribution = "repo" + } + } + scm { + url = "https://github.com/spring-projects/spring-webflow" + connection = "scm:git:git://github.com/spring-projects/spring-webflow" + developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" + } + developers { + developer { + id = "rstoyanchev" + name = "Rossen Stoyanchev" + email = "rstoyanchev@vmware.com" + } + } + issueManagement { + system = "GitHub" + url = "https://github.com/spring-projects/spring-webflow/issues" + } + } + versionMapping { + usage('java-api') { + fromResolutionResult() + } + usage('java-runtime') { + fromResolutionResult() + } + } + } + } +} + +configureDeploymentRepository(project) + +void configureDeploymentRepository(Project project) { + project.plugins.withType(MavenPublishPlugin.class).all { + PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); + if (project.hasProperty("deploymentRepository")) { + publishing.repositories.maven { + it.url = project.property("deploymentRepository") + it.name = "deployment" + } + } + } +} + +// Disable generation of Gradle Module Metadata for compatibility +// with older versions of Spring Web Flow. +tasks.withType(GenerateModuleMetadata) { + enabled = false +} diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle deleted file mode 100644 index 50741140..00000000 --- a/gradle/publish-maven.gradle +++ /dev/null @@ -1,66 +0,0 @@ -apply plugin: "maven-publish" -apply plugin: "com.jfrog.artifactory" - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - if (project.name != 'spring-js-resources') { - artifact sourcesJar - artifact javadocJar - } - versionMapping { - usage('java-api') { - fromResolutionOf('compileClasspath') - } - usage('java-runtime') { - fromResolutionResult() - } - } - pom { - afterEvaluate { - description = project.description - name = project.description - } - url = "https://github.com/spring-projects/spring-webflow" - organization { - name = "Spring IO" - url = "https://spring.io/projects/spring-webflow" - } - licenses { - license { - name = "The Apache Software License, Version 2.0" - url = "https://www.apache.org/licenses/LICENSE-2.0.txt" - distribution = "repo" - } - } - scm { - url = "https://github.com/spring-projects/spring-webflow" - connection = "scm:git:git://github.com/spring-projects/spring-webflow" - developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" - } - developers { - developer { - id = "rstoyanchev" - name = "Rossen Stoyanchev" - email = "rstoyanchev@vmware.com" - } - } - issueManagement { - system = "Jira" - url = "https://jira.spring.io/browse/SWF" - } - } - } - } -} - -artifactoryPublish { - publications(publishing.publications.mavenJava) -} - -// Disable generation of Gradle Module Metadata for compatibility -// with older versions of Spring Web Flow. -tasks.withType(GenerateModuleMetadata) { - enabled = false -} diff --git a/spring-js-resources/spring-js-resources.gradle b/spring-js-resources/spring-js-resources.gradle index d232cad7..09db4d98 100644 --- a/spring-js-resources/spring-js-resources.gradle +++ b/spring-js-resources/spring-js-resources.gradle @@ -46,3 +46,11 @@ jar { dependsOn prepareResources } +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } +} +