/* * MIT License * * Copyright (c) 2020-present Cloudogu GmbH and Contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ plugins { id 'war' id 'org.scm-manager.java' id 'org.scm-manager.run' id 'org.scm-manager.core-plugins' id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.19' } configurations { assets webapp { canBeConsumed = true canBeResolved = false create("swaggerCoreDeps").defaultDependencies(new Action() { @Override void execute(DependencySet dependencies) { dependencies.add(project.getDependencies().create("org.apache.commons:commons-lang3:3.12.0")) dependencies.add(project.getDependencies().create("jakarta.ws.rs:jakarta.ws.rs-api:3.1.0")) dependencies.add(project.getDependencies().create("jakarta.servlet:jakarta.servlet-api:6.0.0")) dependencies.add(project.getDependencies().create("io.swagger.core.v3:swagger-jaxrs2-jakarta:2.2.19")) dependencies.add(project.getDependencies().create("com.fasterxml.jackson.core:jackson-core:2.15.2")) } }) } } dependencies { implementation platform(project(':')) corePlugin project(path: ':scm-plugins:scm-git-plugin', configuration: 'smp') corePlugin project(path: ':scm-plugins:scm-hg-plugin', configuration: 'smp') corePlugin project(path: ':scm-plugins:scm-svn-plugin', configuration: 'smp') corePlugin project(path: ':scm-plugins:scm-legacy-plugin', configuration: 'smp') assets project(path: ':scm-ui', configuration: 'assets') implementation project(':scm-core') implementation project(':scm-dao-xml') testImplementation project(':scm-test') annotationProcessor project(':scm-annotation-processor') // servlet api providedCompile libraries.servletApi testImplementation libraries.servletApi // security implementation libraries.shiroWeb implementation libraries.shiroGuice // tests testImplementation libraries.junitPioneer // jwt implementation libraries.jjwtApi implementation libraries.jjwtRuntime implementation libraries.jjwtJackson // gpg implementation libraries.bouncycastlePg implementation libraries.bouncycastleProv implementation libraries.bouncycastlePkix implementation 'org.pgpainless:pgpainless-core:1.5.0' // json implementation libraries.jacksonJaxbAnnotations implementation libraries.jacksonJaxRsBase implementation libraries.jacksonJaxRsJsonProvider implementation libraries.jacksonDatatypeJdk8 implementation libraries.jacksonDatatypeJsr310 implementation libraries.jacksonDataFormatYaml // rest api implementation libraries.resteasyJaxbProvider implementation libraries.resteasyJackson2Provider implementation libraries.resteasyMultiartProvider implementation libraries.resteasyServletInitializer implementation libraries.resteasyValidatorProvider implementation "org.apache.httpcomponents:httpcore:4.4.16" // openapi compileOnly libraries.swaggerJaxRs // logging implementation libraries.logback // cron expression implementation libraries.cronUtils // templates implementation libraries.mustache // static resources implementation libraries.webResources // content type detection implementation libraries.spotter implementation libraries.tika // restart on unix implementation libraries.akuma // native access implementation libraries.jna // util implementation libraries.commonsCompress // events implementation libraries.legmanShiro implementation libraries.legmanMicrometer // metrics implementation libraries.micrometerExtra implementation libraries.luceneCore implementation libraries.luceneQueryParser implementation libraries.luceneHighlighter implementation libraries.luceneAnalyzersCommon // lombok compileOnly libraries.lombok testCompileOnly libraries.lombok annotationProcessor libraries.lombok testAnnotationProcessor libraries.lombok // dto mapping annotationProcessor libraries.mapstructProcessor // testing async code testImplementation libraries.awaitility // shiro unit testImplementation libraries.shiroUnit // plugin transformer implementation 'org.eclipse.transformer:org.eclipse.transformer:0.5.0' implementation 'org.eclipse.transformer:org.eclipse.transformer.jakarta:0.5.0' } war { from 'build/war' from project.configurations.assets into('WEB-INF/classes/META-INF/scm') { from('build/openapi') } duplicatesStrategy 'WARN' dependsOn 'copy-core-plugins', 'resolve' } artifacts { webapp(war) } // war without assets for development and livereload task 'dev-war'(type: War) { archiveName 'scm-webapp-dev.war' from 'build/war' into('WEB-INF/classes') { from('src/main/conf/config.yml') } into('WEB-INF/classes/META-INF/scm') { from('build/openapi') } duplicatesStrategy 'WARN' dependsOn 'copy-core-plugins', 'resolve' } scmServer { liveReload = true openBrowser = true warFile = file('build/libs/scm-webapp-dev.war') } run { dependsOn 'dev-war' } resolve { outputFileName = 'openapi' outputFormat = 'JSONANDYAML' prettyPrint = 'TRUE' classpath = sourceSets.main.runtimeClasspath resourcePackages = ['sonia.scm.api.v2.resources'] outputDir = file('build/openapi') openApiFile = file('build/openapi_tmp/openapi.yml') setBuildClasspath(project.configurations.swaggerCoreDeps) } task prepareOpenAPI(type: Copy) { from 'src/main/doc/openapi.yml' into 'build/openapi_tmp' duplicatesStrategy 'WARN' expand(version: project.version) } repositories { mavenCentral() } tasks.getByName("resolve").configure { dependsOn 'prepareOpenAPI' }