Добрый день.
Имеется jar файл. Который хочет поднять в свой проект.
Делал все так как описано в документации
Но ничего не вышло.
Вот мой gradle
buildscript {
ext.cubaVersion = '7.2.13'
repositories {
maven {
url 'https://repo.cuba-platform.com/content/groups/work'
credentials {
username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
}
}
flatDir {
dir "${project.rootDir}/lib"
}
}
dependencies {
classpath "com.haulmont.gradle:cuba-plugin:$cubaVersion"
}
}
def modulePrefix = ‘app’
def globalModule = project(":${modulePrefix}-global")
def coreModule = project(":${modulePrefix}-core")
def webModule = project(":${modulePrefix}-web")
def webToolkitModule = project(":${modulePrefix}-web-toolkit")
def servletApi = ‘javax.servlet:javax.servlet-api:3.1.0’
apply(plugin: ‘cuba’)
cuba {
artifact {
group = ‘com.company.obossatyi’
version = ‘0.1’
isSnapshot = true
}
}
dependencies {
appComponent(“com.haulmont.cuba:cuba-global:$cubaVersion”)
appComponent(“com.haulmont.charts:charts-global:$cubaVersion”)
}
def mssql = ‘net.sourceforge.jtds:jtds:1.3.1’
configure([globalModule, coreModule, webModule, webToolkitModule]) {
apply(plugin: ‘java’)
apply(plugin: ‘maven’)
apply(plugin: ‘cuba’)
dependencies {
testCompile('org.junit.jupiter:junit-jupiter-api:5.5.2')
testCompile('org.junit.jupiter:junit-jupiter-engine:5.5.2')
testCompile('org.junit.vintage:junit-vintage-engine:5.5.2')
}
task sourceJar(type: Jar) {
from file('src')
classifier = 'sources'
}
artifacts {
archives sourceJar
}
test {
useJUnitPlatform()
}
}
configure(globalModule) {
dependencies {
if (!JavaVersion.current().isJava8()) {
runtime(‘javax.xml.bind:jaxb-api:2.3.1’)
runtime(‘org.glassfish.jaxb:jaxb-runtime:2.3.1’)
compile(name: ‘ehosrv.dao’)
}
}
entitiesEnhancing {
main {
enabled = true
}
}
}
configure(coreModule) {
configurations {
jdbc
dbscripts
}
dependencies {
compile(globalModule)
compileOnly(servletApi)
jdbc(mssql)
testRuntime(mssql)
}
task cleanConf(description: 'Cleans up conf directory', type: Delete) {
delete "$cuba.appHome/${modulePrefix}-core/conf"
}
task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
appName = "${modulePrefix}-core"
appJars(modulePrefix + '-global', modulePrefix + '-core')
}
task createDb(dependsOn: assembleDbScripts, description: 'Creates local database', type: CubaDbCreation) {
}
task updateDb(dependsOn: assembleDbScripts, description: 'Updates local database', type: CubaDbUpdate) {
}
}
configure(webModule) {
configurations {
webcontent
}
dependencies {
compileOnly(servletApi)
compile(globalModule)
}
jar {
with copySpec {
from sourceSets.main.allJava
include "com/company/obossatyi/web/toolkit/ui/client/**"
}
}
task webArchive(type: Zip) {
from file("$buildDir/web")
from file('web')
classifier = 'web'
}
artifacts {
archives webArchive
}
task deployConf(type: Copy) {
from file('src')
include "com/company/obossatyi/**"
into "$cuba.appHome/${modulePrefix}/conf"
}
task clearMessagesCache(type: CubaClearMessagesCache) {
appName = "${modulePrefix}"
}
deployConf.dependsOn clearMessagesCache
task cleanConf(description: 'Cleans up conf directory', type: Delete) {
delete "$cuba.appHome/${modulePrefix}/conf"
}
task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
appName = "${modulePrefix}"
appJars(modulePrefix + '-global', modulePrefix + '-web')
}
}
configure(webToolkitModule) {
dependencies {
compile(webModule)
}
jar {
from sourceSets.main.allJava
}
task buildWidgetSet(type: CubaWidgetSetBuilding) {
widgetSetClass = 'com.company.obossatyi.web.toolkit.ui.AppWidgetSet'
}
task debugWidgetSet(type: CubaWidgetSetDebug) {
widgetSetClass = 'com.company.obossatyi.web.toolkit.ui.AppWidgetSet'
}
task webArchive(dependsOn: buildWidgetSet, type: Jar) {
from file("$buildDir/web")
classifier = 'client'
}
artifacts {
archives webArchive
}
task deploy(dependsOn: webArchive, type: Copy) {
from webArchive
into "$cuba.tomcat.dir/webapps/${modulePrefix}/WEB-INF/lib"
}
}
task undeploy(type: Delete, dependsOn: “:${modulePrefix}-web:cleanConf”) {
delete("$cuba.tomcat.dir/shared")
delete("$cuba.tomcat.dir/webapps/${modulePrefix}-core")
delete("$cuba.tomcat.dir/webapps/${modulePrefix}")
}
task restart(dependsOn: [‘stop’, “:${modulePrefix}-core:deploy”, “:${modulePrefix}-web:deploy”, “:${modulePrefix}-web-toolkit:deploy”], description: ‘Redeploys applications and restarts local Tomcat’) {
doLast {
ant.waitfor(maxwait: 6, maxwaitunit: ‘second’, checkevery: 2, checkeveryunit: ‘second’) {
not {
socket(server: ‘localhost’, port: ‘8787’)
}
}
}
}
restart.finalizedBy start