Skip to content

Commit

Permalink
gradle deprecation fixes testing
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Jan 22, 2025
1 parent 8ec4372 commit febda08
Show file tree
Hide file tree
Showing 74 changed files with 312 additions and 219 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/'
url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/'
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}

buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2017, 2024.
* (C) Copyright IBM Corporation 2017, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -677,7 +677,8 @@ abstract class AbstractServerTask extends AbstractLibertyTask {
application.appendNode('applicationFilename', appObj.getArchiveFileName().get())
}
if (appObj instanceof War) {
application.appendNode('warSourceDirectory', project.webAppDirName)
War war=appObj
application.appendNode('warSourceDirectory', war.webAppDirectory.getAsFile().get())
}
} else if (appObj instanceof File) {
application.appendNode('appsDirectory', appDir)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2015, 2023.
* (C) Copyright IBM Corporation 2015, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,8 +21,8 @@ import org.gradle.api.logging.LogLevel
class CleanTask extends AbstractServerTask {
CleanTask() {
configure({
description 'Deletes files from some directories from the Liberty server'
group 'Liberty'
description = 'Deletes files from some directories from the Liberty server'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2017, 2024.
* (C) Copyright IBM Corporation 2017, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,8 +29,8 @@ class CompileJSPTask extends AbstractFeatureTask {

CompileJSPTask() {
configure({
description 'Compile the JSP files in the src/main/webapp directory. '
group 'Liberty'
description = 'Compile the JSP files in the src/main/webapp directory. '
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,8 +29,8 @@ class CreateTask extends AbstractServerTask {

CreateTask() {
configure({
description 'Creates a Liberty server.'
group 'Liberty'
description = 'Creates a Liberty server.'
group = 'Liberty'
})
outputs.upToDateWhen {
getServerDir(project).exists() && (new File(getServerDir(project), 'server.xml')).exists() && !isServerDirChanged(project)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,8 +57,8 @@ class DeployTask extends AbstractServerTask {

DeployTask() {
configure({
description "Copy applications generated by the Gradle project to a Liberty server's dropins or apps directory."
group 'Liberty'
description = "Copy applications generated by the Gradle project to a Liberty server's dropins or apps directory."
group = 'Liberty'
project.afterEvaluate {
springBootVersion = findSpringBootVersion(project)
springBootTask = findSpringBootTask(project, springBootVersion)
Expand Down Expand Up @@ -133,7 +133,7 @@ class DeployTask extends AbstractServerTask {
} else {
archiveBaseName = task.getArchiveBaseName().get()
fileName = getArchiveName(task)
Files.copy(task.archivePath.toPath(), new File(getServerDir(project), "/" + appsDir + "/" + getArchiveName(task)).toPath(), StandardCopyOption.REPLACE_EXISTING)
Files.copy(task.archiveFile.get().getAsFile().toPath(), new File(getServerDir(project), "/" + appsDir + "/" + getArchiveName(task)).toPath(), StandardCopyOption.REPLACE_EXISTING)
validateAppConfig(getArchiveName(task), archiveBaseName, appsDir)
}
validateAppConfig(fileName, archiveBaseName, appsDir)
Expand Down Expand Up @@ -167,10 +167,10 @@ class DeployTask extends AbstractServerTask {
String archiveOutputPath;

if (isSpringBoot2plus(springBootVersion)) {
archiveOutputPath = springBootTask.archivePath.getAbsolutePath()
archiveOutputPath = springBootTask.archiveFile.get().getAsFile().getAbsolutePath()
}
else if(isSpringBoot1(springBootVersion)) {
archiveOutputPath = springBootTask.archivePath.getAbsolutePath()
archiveOutputPath = springBootTask.archiveFile.get().getAsFile().getAbsolutePath()
if (project.bootRepackage.classifier != null && !project.bootRepackage.classifier.isEmpty()) {
archiveOutputPath = archiveOutputPath.substring(0, archiveOutputPath.lastIndexOf(".")) + "-" + project.bootRepackage.classifier + "." + springBootTask.getArchiveExtension().get()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2019, 2024.
* (C) Copyright IBM Corporation 2019, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -68,8 +68,8 @@ class DevTask extends AbstractFeatureTask {

DevTask() {
configure({
description 'Runs a Liberty server in dev mode'
group 'Liberty'
description = 'Runs a Liberty server in dev mode'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2020.
* (C) Copyright IBM Corporation 2020, 2025
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,8 +21,8 @@ class DevcTask extends DevTask {

DevcTask() {
configure({
description 'Runs a Liberty server in dev mode inside of a Docker container'
group 'Liberty'
description = 'Runs a Liberty server in dev mode inside of a Docker container'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2015, 2019.
* (C) Copyright IBM Corporation 2015, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,8 +22,8 @@ class DumpTask extends AbstractServerTask {

DumpTask() {
configure({
description 'Dumps diagnostic information from the Liberty server into an archive.'
group 'Liberty'
description = 'Dumps diagnostic information from the Liberty server into an archive.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2021, 2024.
* (C) Copyright IBM Corporation 2021, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,8 +49,8 @@ class GenerateFeaturesTask extends AbstractFeatureTask {

GenerateFeaturesTask() {
configure({
description 'Generate the features used by an application and add to the configuration of a Liberty server'
group 'Liberty'
description = 'Generate the features used by an application and add to the configuration of a Liberty server'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,8 +33,8 @@ class InstallFeatureTask extends AbstractFeatureTask {

InstallFeatureTask() {
configure({
description 'Install a new feature to the Liberty server'
group 'Liberty'
description = 'Install a new feature to the Liberty server'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,8 +42,8 @@ class InstallLibertyTask extends AbstractLibertyTask {

InstallLibertyTask() {
configure({
description 'Installs Liberty from a repository'
group 'Liberty'
description = 'Installs Liberty from a repository'
group = 'Liberty'
})
outputs.upToDateWhen {
// ensure a Liberty installation exists at the install directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2015, 2019.
* (C) Copyright IBM Corporation 2015, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,8 +22,8 @@ class JavaDumpTask extends AbstractServerTask {

JavaDumpTask() {
configure({
description 'Dumps diagnostic information from the Liberty server JVM.'
group 'Liberty'
description = 'Dumps diagnostic information from the Liberty server JVM.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,8 +62,8 @@ class PackageTask extends AbstractServerTask {

PackageTask() {
configure({
description 'Generates a Liberty server archive.'
group 'Liberty'
description = 'Generates a Liberty server archive.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2021.
* (C) Copyright IBM Corporation 2021, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,8 +31,8 @@ class PrepareFeatureTask extends AbstractPrepareTask {

PrepareFeatureTask() {
configure({
description 'Prepare a user feature for upload to a maven repository'
group 'Liberty'
description = 'Prepare a user feature for upload to a maven repository'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2023.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,8 @@ class RunTask extends AbstractServerTask {

RunTask() {
configure({
description "Runs a Liberty server under the Gradle process."
group 'Liberty'
description = "Runs a Liberty server under the Gradle process."
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,8 +27,8 @@ class StartTask extends AbstractServerTask {

StartTask() {
configure({
description 'Starts the Liberty server.'
group 'Liberty'
description = 'Starts the Liberty server.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2023.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,8 +22,8 @@ class StatusTask extends AbstractServerTask {

StatusTask() {
configure({
description 'Checks if the Liberty server is running.'
group 'Liberty'
description = 'Checks if the Liberty server is running.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2023.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,8 @@ class StopTask extends AbstractServerTask {

StopTask() {
configure({
description 'Stops the Liberty server.'
group 'Liberty'
description = 'Stops the Liberty server.'
group = 'Liberty'
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2024.
* (C) Copyright IBM Corporation 2014, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,8 +32,8 @@ class UndeployTask extends AbstractServerTask {

UndeployTask() {
configure({
description 'Removes an application from the Liberty server.'
group 'Liberty'
description = 'Removes an application from the Liberty server.'
group = 'Liberty'
})
}

Expand Down
Loading

0 comments on commit febda08

Please sign in to comment.