Gradle Multiproject - OpenClover - java

I am trying to integrate Open Clover into my Gradle build process and was following the following guide:
When I added it to my build.gradle - I got the following error:
* * What went wrong:
A problem occurred evaluating root project 'Enjin-Coin-Java-SDK'.
> Could not find method cloverCompile() for arguments [org.openclover:clover:4.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler..
My build.gradle file is as follows:
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'org.openclover:clover:4.2.0'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'java'
}
sourceSets {
clover {
java {
srcDir "$buildDir/sources-instr"
}
}
}
apply from: 'gradle/util.gradle'
subprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'com.myproject'
version = '0.0.1-SNAPSHOT'
idea {
module {
scopes.PROVIDED.plus += [configurations.shadow]
}
}
tasks.build.dependsOn(shadowJar)
artifacts.archives shadowJar
tasks.withType(AbstractCompile) {
classpath += configurations.shadow
}
ext {
mockito = '2.9.0'
junit = '4.12'
powermock = '1.7.3'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// testCompile dependencies
testCompile group: 'org.mockito', name: 'mockito-core', version: mockito
testCompile group: 'junit', name: 'junit', version: junit
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: powermock
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: powermock
cloverCompile 'org.openclover:clover:4.2.0'
}
jar {
archiveName = "${project.name}-slim.jar"
}
shadowJar {
archiveName = "${project.name}.jar"
}
install {
repositories.mavenInstaller {
pom.artifactId = "sdk-${project.name}"
}
}
}
configurations {
cloverRuntime
cloverRuntime.extendsFrom cloverCompile
}
task cloverInstr() {
inputs.files sourceSets.main.allJava
outputs.dir "$buildDir/sources-instr"
doFirst {
def argsList = ["--initstring", "${buildDir}/clover/clover.db", "-d", "${buildDir}/sources-instr"]
argsList.addAll(inputs.files.files.collect({ file ->
file.absolutePath
}))
String[] args = argsList.toArray()
com.atlassian.clover.CloverInstr.mainImpl(args)
}
}
cloverClasses.dependsOn cloverInstr
test {
def cloverClasspath = configurations.testRuntime + configurations.cloverRuntime + sourceSets.test.output + sourceSets.clover.output
classpath = cloverClasspath
}
task cloverReport {
inputs.dir "${buildDir}/clover"
outputs.dir "${reportsDir}/clover"
onlyIf {
file("${buildDir}/clover/clover.db").exists()
}
doFirst {
def argsList = ["--initstring", "${buildDir}/clover/clover.db",
"-o", "${reportsDir}/clover"]
String[] args = argsList.toArray()
com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
}
}
The contents of util.gradle are as follows
ext.scriptFile = {
String fileName ->
return new File(new File(rootDir, 'gradle'), fileName)
}
Can anyone offer any assistance in how to resolve this?

Use the following script to integrate clover into your project:
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id "com.bmuschko.clover" version "2.1.3"
}
apply from: 'gradle/util.gradle'
subprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.bmuschko.clover'
group = 'com.myproject'
version = '0.0.1-SNAPSHOT'
idea {
module {
scopes.PROVIDED.plus += [configurations.shadow]
}
}
tasks.build.dependsOn(shadowJar)
artifacts.archives shadowJar
tasks.withType(AbstractCompile) {
classpath += configurations.shadow
}
ext {
mockito = '2.9.0'
junit = '4.12'
powermock = '1.7.3'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// testCompile dependencies
testCompile group: 'org.mockito', name: 'mockito-core', version: mockito
testCompile group: 'junit', name: 'junit', version: junit
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: powermock
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: powermock
clover 'org.openclover:clover:4.2.0'
}
jar {
archiveName = "${project.name}-slim.jar"
}
shadowJar {
archiveName = "${project.name}.jar"
}
install {
repositories.mavenInstaller {
pom.artifactId = "sdk-${project.name}"
}
}
}
There's no need for manual integration if ready-to-use plugin is available.

Related

I have an error but dependencies include in gradle root and gradle module config, why?

I have root config gradle.build
plugins {
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'idea'
}
idea {
project {
languageLevel = 14
}
module {
downloadJavadoc = true
downloadSources = true
}
}
allprojects {
group "ru.otus"
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
apply plugin: "io.spring.dependency-management"
dependencyManagement {
dependencies {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:2.3.5.RELEASE")
}
dependency("org.projectlombok:lombok:1.18.16")
dependency("org.springframework.shell:spring-shell-starter:2.0.1.RELEASE")
dependency("org.springframework.boot:spring-boot-starter-data-jpa:2.3.5.RELEASE")
dependency("org.flywaydb:flyway-core:6.4.4")
dependency("org.postgresql:postgresql:42.2.16")
dependency("org.hamcrest:hamcrest-core:1.3")
dependency("org.springframework.boot:spring-boot-starter-test:2.3.5.RELEASE")
}
}
configurations.all {
resolutionStrategy {
failOnVersionConflict()
}
resolutionStrategy {
force("javax.servlet:servlet-api:2.4")
force("commons-logging:commons-logging:1.1.1")
force("commons-lang:commons-lang:2.5")
force("org.codehaus.jackson:jackson-core-asl:1.8.8")
force("org.codehaus.jackson:jackson-mapper-asl:1.8.3")
force("org.codehaus.jettison:jettison:1.1")
force("org.javassist:javassist:3.24.0-GA")
force("org.apiguardian:apiguardian-api:1.1.0")
force("org.opentest4j:opentest4j:1.2.0")
}
}
}
and have build.gradle in module
plugins {
id 'java'
}
version = '0.0.1-SNAPSHOT'
dependencies {
implementation group: 'org.springframework.shell', name: 'spring-shell-starter', version: '2.0.1.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.3.5.RELEASE'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '6.4.4'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.3.5.RELEASE'
}
After download dependencies and add in models annotations like #Entity, #Table #Id and etc. i have an error: cannot find symbol
#Entity
^
symbol: class Entity
But i have spring-boot-starter-jpa in dependencies, i don't know why in module i can't use dependencies.
With dependencyManagement you only manage dependencies like version, overrides etc. you don't actually add dependencies to a project. For that use dependencies like you use in the other places.

Build Gradle Local Dependency

How do you declare a local dependency for gradle 4.10.3 to not use the github project and use your own custom build of the project? Open source project I'm trying to compile https://github.com/kami-blue/client
My build is at /Users/macbook/Desktop/baritone-master/dist/baritone-api-1.2.14.jar
I've tried changing the file path to it and commenting out the two compile commands but that didn't work.
//compile 'com.github.cabaletta:baritone:1.2.14'
//compile 'cabaletta:baritone-api:1.2'
include(dependency('/Users/macbook/Desktop/baritone-master/dist/baritone-api-1.2.14.jar'))
Using these either of these two methods do not work either:
implementation files('/Users/macbook/Desktop/baritone-master/dist/baritone-api-1.2.14.jar')
compile fileTree(dir: '/Users/macbook/Desktop/baritone-master/dist', include: ['*.jar'])
build.gradle file:
buildscript {
repositories {
jcenter()
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = 'SpongePowered'
url = 'http://repo.spongepowered.org/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: "${kotlin_version}" }
}
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'
version project.modVersion
group project.modGroup // http://maven.apache.org/guides/mini/guide-naming-conventions.html
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = project.forgeVersion
runDir = 'run'
mappings = project.mcpVersion
coreMod = 'me.zeroeightsix.kami.mixin.MixinLoaderForge'
makeObfSourceJar = false
}
repositories {
maven {
name = 'spongepowered-repo'
url = 'http://repo.spongepowered.org/maven/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
maven {
name = 'swt-repo'
url = "http://maven-eclipse.github.io/maven"
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
maven {
name = "forgelin-repo"
url "http://maven.shadowfacts.net/"
}
mavenCentral()
jcenter()
}
dependencies {
// mixin needs to be distributed with the mod, very important
compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") { // do NOT update this to 8.0 or above, it breaks compatibility with future client
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core' // we want to exclude this as well because 0.7.11 includes it too new for MC
}
compile "com.github.ZeroMemes:Alpine:1.7"
compile group: 'net.jodah', name: 'typetools', version: '0.6.2'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.26'
compile(group: 'org.reflections', name: 'reflections', version: '0.9.12') {
exclude group: 'com.google.guava', module: 'guava'
}
compile 'club.minnced:java-discord-rpc:2.0.2'
compile 'com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT'
compile 'com.github.kevinsawicki:http-request:http-request-6.0'
compile 'com.github.cabaletta:baritone:1.2.14'
compile 'cabaletta:baritone-api:1.2'
compile group: "net.shadowfacts", name: "Forgelin", version: "1.8.4"
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk7", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: kotlin_version
compile group: "org.jetbrains", name: "annotations", version: annotations_version
compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: coroutines_version
compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-jdk8", version: coroutines_version
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// move _at.cfg into META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
shadowJar {
dependencies {
include(dependency('org.spongepowered:mixin'))
include(dependency('com.github.ZeroMemes:Alpine'))
include(dependency('club.minnced:java-discord-rpc'))
include(dependency('net.jodah:typetools'))
include(dependency('org.yaml:snakeyaml'))
include(dependency('org.reflections:reflections'))
include(dependency('org.javassist:javassist'))
include(dependency('com.github.MrPowerGamerBR:TemmieWebhook'))
include(dependency('com.github.kevinsawicki:http-request'))
include(dependency('cabaletta:baritone-api'))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"))
include(dependency("org.jetbrains:annotations:${annotations_version}"))
include(dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutines_version}"))
include(dependency("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${coroutines_version}"))
include(dependency('net.shadowfacts:Forgelin'))
}
exclude 'dummyThing' // can someone explain why this is here
classifier = 'release'
}
mixin {
defaultObfuscationEnv searge
add sourceSets.main, 'mixins.kami.refmap.json'
}
reobf {
shadowJar {
mappingType = 'SEARGE'
classpath = sourceSets.main.compileClasspath
}
}
// Don't put baritone mixin here please c:
jar {
manifest {
attributes(
'MixinConfigs': 'mixins.kami.json',
'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'me.zeroeightsix.kami.mixin.MixinLoaderForge',
'ForceLoadAsMod': 'true',
'FMLAT': 'kami_at.cfg'
)
}
}
build.dependsOn(shadowJar)
Please try this. Should fix your problem.
In this case gradle will try to use a relative path for a local jar dependency.
Read those documentaries for more information
dependencies {
implementation files('/Users/macbook/Desktop/baritone-master/dist/baritone-api-1.2.14.jar')
}
Additionally you can add all jars in X directory.
dependencies {
compile fileTree(dir: 'yourDirection', include: ['*.jar'])
}

Gradle when run with bootRun generate can't find symbol isEmpty

I'm using Gradle to compile project, when I run it with bootRun it output the following error:
can't find symbol isEmpty, that's a lot of them, I knew that's something with the java version, but I don't know how to correct them, it's a shame they don't allow short version post.
Here is my gradle config:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.springframework.boot' version '2.2.0.M5'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'net.ltgt.apt' version '0.20'
}
apply plugin: 'net.ltgt.apt-idea'
apply plugin: 'kotlin'
apply plugin: 'net.ltgt.apt-eclipse'
group = 'com.fanjiu'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
mapstruct
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
ext {
set('springCloudVersion', "Hoxton.M2")
generatedMapperSourcesDir = "${buildDir}/generated-src/mapstruct/main"
}
sourceSets.main {
ext.originalJavaSrcDirs = java.srcDirs
java.srcDir "${generatedMapperSourcesDir}"
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-cloud-connectors'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation('com.github.binarywang:wx-java-miniapp-spring-boot-starter:3.5.0')
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-security")
compile('org.modelmapper:modelmapper:2.3.5')
implementation 'org.springframework.cloud:spring-cloud-starter'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation "org.mapstruct:mapstruct"
annotationProcessor "org.mapstruct:mapstruct-processor"
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
compile 'org.mapstruct:mapstruct:1.3.0.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.3.0.Final'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile 'com.qiniu:qiniu-java-sdk:7.2.+'
compile 'com.alibaba:fastjson:1.2.61'
compile group: 'org.ocpsoft.prettytime', name: 'prettytime', version: '4.0.2.Final'
compile group: 'org.ocpsoft.prettytime', name: 'prettytime-nlp', version: '4.0.2.Final'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
task generateMainMapperClasses(type: JavaCompile) {
ext.aptDumpDir = file( "${buildDir}/tmp/apt/mapstruct" )
destinationDir = ext.aptDumpDir
classpath = compileJava.classpath + configurations.mapstruct
source = sourceSets.main.originalJavaSrcDirs
ext.sourceDestDir = file ( "$generatedMapperSourcesDir" )
options.define(
compilerArgs: [
"-nowarn",
"-proc:only",
"-encoding", "UTF-8",
"-processor", "org.mapstruct.ap.MappingProcessor",
"-s", ext.sourceDestDir.absolutePath,
"-source", rootProject.sourceCompatibility,
"-target", rootProject.sourceCompatibility,
]
);
inputs.dir source
outputs.dir generatedMapperSourcesDir;
doFirst {
ext.sourceDestDir.mkdirs()
}
doLast {
ext.aptDumpDir.delete()
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
//compileJava.dependsOn generateMainMapperClasses
Yes. JDK version, upgrade JDK version solve the problem. And update the file with sourceCompatibility = '13'

Running Spring Boot Application on WebSphere 9

I've a Spring Boot Application with main class:
#SpringBootApplication
public class MyApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(MyApplication .class, args);
}
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(applicationClass);
}
private static Class<MyApplication > applicationClass = MyApplication .class;
}
With gradle.build:
version '1.0'
// dependencies for command line
buildscript {
ext {
springBootVersion = '1.4.3.RELEASE'
dependencyManagementVersion = '0.6.0.RELEASE'
}
repositories {
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:${dependencyManagementVersion}"
}
}
apply plugin: "io.spring.dependency-management"
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'idea'
// JDK 8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
jcenter()
}
ext {
springCloudVersion = 'Brixton.SR4'
springBootVersion = '1.4.3.RELEASE'
swaggerVersion = '2.4.0'
jodaTimeVersion = '2.9.4'
jacksonJodaVersion = '2.5.1'
junitVersion = '4.12'
springWsTestVersion = '2.2.3.RELEASE'
lombokVersion = '1.16.10'
jsonPathVersion = '2.2.0'
ehcacheVersion = '3.2.0'
javaxCacheVersion = '1.0.0'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
}
}
sourceSets {
test {
java {
srcDir 'src/test/unit/java'
}
resources {
srcDir 'src/test/unit/resources'
}
}
}
tasks.withType(JavaExec) {
if (System.getProperty("DEBUG", 'false') == 'true') {
jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006'
}
}
dependencies {
// https://mvnrepository.com/artifact/javax/javaee-api
compile group: 'javax', name: 'javaee-api', version: '7.0'
/* core libraries */
compile('org.springframework.cloud:spring-cloud-starter-config') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-hateoas"){
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile 'org.springframework.ws:spring-ws-core'
// tag::actuator[]; for #RefreshScope
compile("org.springframework.boot:spring-boot-starter-actuator"){
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
// end::actuator[]
// logging
compile('org.springframework.boot:spring-boot-starter-log4j2')
compile('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml')
compile('com.fasterxml.jackson.core:jackson-databind')
// embedded server
providedRuntime ('org.springframework.boot:spring-boot-starter-tomcat')
// https://mvnrepository.com/artifact/org.projectlombok/lombok-maven
compile "org.projectlombok:lombok:${lombokVersion}"
// https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path
// A Java DSL for reading JSON documents
compile "com.jayway.jsonpath:json-path:${jsonPathVersion}"
//for EhCache
// https://mvnrepository.com/artifact/org.ehcache/ehcache
compile "org.ehcache:ehcache:${ehcacheVersion}"
// https://mvnrepository.com/artifact/javax.cache/cache-api
compile "javax.cache:cache-api:${javaxCacheVersion}"
// utilities
compile "io.springfox:springfox-swagger2:${swaggerVersion}"
compile "io.springfox:springfox-swagger-ui:${swaggerVersion}"
compile "joda-time:joda-time:${jodaTimeVersion}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:${jacksonJodaVersion}"
compile ("org.springframework.boot:spring-boot-starter-aop") {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile "org.aspectj:aspectjweaver:1.8.8"
/* plugins */
/* test libraries */
// unit
testCompile "junit:junit:${junitVersion}"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.springframework.ws:spring-ws-test:${springWsTestVersion}"
}
war {
archiveName = "${project.name}.war"
manifest {
attributes 'Main-Class': 'com..content.MyApplication'
}
}
When I try to deploy the war file on WebSphere Application Server 9.0 Traditional, it starts but takes very long time. Without war file, server starts and stops very normally, but with application, server hangs.
Am I missing something?
Thank you for help!!
The startup delay is probably caused by CDI's implicit bean archive scanning. If you are not using CDI, you can disable implicit bean archives with com.ibm.ws.cdi.enableImplicitBeanArchives=false.
You can find a much more detailed explanation in this tech note:
Custom Properties for improving application startup in WebSphere Application Server

Can't connect to my nexus repository by using gradle

I've got following build.gradle file:
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'eclipse'
buildscript {
repositories {
maven {
url "<myURL>/nexus/content/groups/public"
}
}
dependencies {
}
}
jar {
baseName = 'myAppName'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven {
url "<myURL>/nexus/content/groups/public/"
credentials {
username "nexusUser"
password "nexusPassword"
}
}
maven {
url "<myURL>/nexus/content/repositories/snapshots"
credentials {
username "nexusUser"
password "nexusPassword"
}
}
}
dependencies {
compile group: 'javax', name: 'javaee-api', version: '7.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.5'
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:1.10.19'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "<myURL>/content/repositories/releases") {
authentication(userName: nexusUsername, password: nexusPassword)
}
snapshotRepository(url: "<myURL>/nexus/content/repositories/snapshots") {
authentication(userName: nexusUsername, password: nexusPassword)
}
pom.version = "0.0.1-SNAPSHOT"
pom.artifactId = "app-name-commons"
pom.groupId = "de.commons"
}
}
}
My Problem is that I can't neither upload artifacts to my nexus repo nore I get the dependencies like javaee-api etc. The credential are defined in a gradle.properties file. Has anybody a hint why this doesn't work?
Update
If I make the repositories readable for anonymous users i get the dependencies. So it seems the problem is the login.

Categories