Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix deprecation warnings during build (#1577)

Wouter Borna03620546777
diff --git a/agent/build.gradle b/agent/build.gradle
index 8061428fc..6c77daa21 100644
--- a/agent/build.gradle
+++ b/agent/build.gradle
@@ -40,8 +40,8 @@ dependencies {
implementation "org.jdom:jdom2:$jdomVersion"
}
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
javadoc {
diff --git a/container/build.gradle b/container/build.gradle
index 7385736a0..b0585bca0 100644
--- a/container/build.gradle
+++ b/container/build.gradle
@@ -49,8 +49,8 @@ dependencies {
api "io.micrometer:micrometer-registry-prometheus:$micrometerVersion"
}
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
javadoc {
diff --git a/deployment/build.gradle b/deployment/build.gradle
index cff1c71c0..0e49d3baf 100644
--- a/deployment/build.gradle
+++ b/deployment/build.gradle
@@ -1,7 +1,12 @@
apply plugin: "java-library"
+configurations {
+ managerRuntime
+}
+
dependencies {
api project(":setup")
+ managerRuntime(project(path: ':manager', configuration: 'runtime'))
}
task license {
diff --git a/manager/build.gradle b/manager/build.gradle
index 37474232f..2ca39b5ce 100644
--- a/manager/build.gradle
+++ b/manager/build.gradle
@@ -6,7 +6,9 @@ apply plugin: "distribution"
apply plugin: "maven-publish"
apply plugin: "signing"
-mainClassName = "org.openremote.manager.Main"
+application {
+ mainClass = "org.openremote.manager.Main"
+}
dependencies {
@@ -61,8 +63,20 @@ dependencies {
implementation "com.github.mwiede:jsch:$jSchVersion"
}
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
+}
+
+configurations {
+ runtime {
+ canBeConsumed = true
+ canBeResolved = false
+ extendsFrom implementation, runtimeOnly
+ }
+}
+
+artifacts {
+ runtime(jar)
}
afterEvaluate {
@@ -165,7 +179,7 @@ signing {
// Output version.properties file
tasks.register('setVersionProperties', WriteProperties) {
- outputFile = Paths.get(projectDir.path, "src", "main", "resources", "version.properties").toFile()
+ destinationFile = Paths.get(projectDir.path, "src", "main", "resources", "version.properties").toFile()
property 'version', project.version
}
diff --git a/model-util/build.gradle b/model-util/build.gradle
index 820491d52..ab045e329 100644
--- a/model-util/build.gradle
+++ b/model-util/build.gradle
@@ -15,9 +15,12 @@ dependencies {
implementation "cz.habarta.typescript-generator:typescript-generator-core:$typescriptGeneratorVersion"
}
+base {
+ archivesName = "openremote-${project.name}"
+}
+
jar {
from sourceSets.main.allJava
- archivesBaseName = "openremote-${project.name}"
}
javadoc {
diff --git a/model/build.gradle b/model/build.gradle
index dd68bbf66..6e0841469 100644
--- a/model/build.gradle
+++ b/model/build.gradle
@@ -37,9 +37,12 @@ dependencies {
api "com.fasterxml.uuid:java-uuid-generator:$uuidGeneratorVersion"
}
+base {
+ archivesName = "openremote-${project.name}"
+}
+
jar {
from sourceSets.main.allJava
- archivesBaseName = "openremote-${project.name}"
}
javadoc {
diff --git a/model/src/main/java/org/openremote/model/attribute/Attribute.java b/model/src/main/java/org/openremote/model/attribute/Attribute.java
index eb61b974c..c764a0f56 100644
--- a/model/src/main/java/org/openremote/model/attribute/Attribute.java
+++ b/model/src/main/java/org/openremote/model/attribute/Attribute.java
@@ -90,7 +90,7 @@ public class Attribute<T> extends AbstractNameValueHolder<T> implements MetaHold
}
AssetTypeInfo assetTypeInfo = (AssetTypeInfo) ctxt.getAttribute(Asset.AssetDeserializer.ASSET_TYPE_INFO_ATTRIBUTE);
- String attributeName = jp.getCurrentName();
+ String attributeName = jp.currentName();
AttributeDescriptor<?> attributeDescriptor = assetTypeInfo != null ? assetTypeInfo.getAttributeDescriptors().get(attributeName) : null;
Attribute<?> attribute;
diff --git a/model/src/main/java/org/openremote/model/attribute/MetaMap.java b/model/src/main/java/org/openremote/model/attribute/MetaMap.java
index 4eefe503c..1d609bc91 100644
--- a/model/src/main/java/org/openremote/model/attribute/MetaMap.java
+++ b/model/src/main/java/org/openremote/model/attribute/MetaMap.java
@@ -80,7 +80,7 @@ public class MetaMap extends NamedMap<MetaItem<?>> {
continue;
}
- String metaItemName = jp.getCurrentName();
+ String metaItemName = jp.currentName();
MetaItemDescriptor<?> metaItemDescriptor = metaDescriptorProvider.apply(metaItemName);
MetaItem metaItem;
diff --git a/project.gradle b/project.gradle
index 681872287..afd628ce5 100644
--- a/project.gradle
+++ b/project.gradle
@@ -191,20 +191,21 @@ def getYarnInstallTask() {
// Gets the list of runtime JAR dependencies; can be used in custom project deployment installDist task to populate
// extensions directory
-def getDeploymentJars(Project project = project) {
- if (project.configurations.find { it.name == "runtimeClasspath" } == null) {
+def getDeploymentJars(Project project = project, String excludeConfigName = 'managerRuntime') {
+ if (project.configurations.find { it.name == excludeConfigName } == null) {
return []
}
// Get all dependencies that are already part of the openremote manager and exclude these from the libs dir
// otherwise they will appear on the classpath twice (once in manager app dir and then again in extensions)
- def excludeDependencies = resolveProject(":manager").configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
+ def excludeDependencies = project.configurations.getByName(excludeConfigName).resolvedConfiguration.resolvedArtifacts
- return project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.findAll {
- dep -> excludeDependencies.find { it == dep } == null && dep.name != "openremote-manager" }.collect {
- println "CopyLibs Artifact: ${it.file.path}"
- return it.file
- }
+ return project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
+ .findAll { dep -> excludeDependencies.find { it == dep } == null && dep.name != "openremote-manager" }
+ .collect {
+ println "CopyLibs Artifact: ${it.file.path}"
+ return it.file
+ }
}
/**
@@ -395,8 +396,10 @@ plugins.withType(JavaPlugin).whenPluginAdded {
// Allow dependencyInsight checks across all projects
task allDependencyInsight(type: DependencyInsightReportTask) {}
- // JAR/ZIP base name is the fully qualified subproject name
- archivesBaseName = "${rootProject.name}${path.replaceAll(":", "-")}"
+ base {
+ // JAR/ZIP base name is the fully qualified subproject name
+ archivesName = "${rootProject.name}${path.replaceAll(":", "-")}"
+ }
}
// POM generator
diff --git a/setup/build.gradle b/setup/build.gradle
index 5176ba69e..7ae387958 100644
--- a/setup/build.gradle
+++ b/setup/build.gradle
@@ -18,14 +18,18 @@ dependencies {
}
task (load1Jar, type: Jar) {
- archivesBaseName = "openremote-load1-${project.name}"
+ base {
+ archivesName = "openremote-load1-${project.name}"
+ }
from sourceSets.load1.output
}
// Order of JAR tasks affects the name of the final jar but not the contents which is odd
// So putting demo last
task (demoJar, type: Jar) {
- archivesBaseName = "openremote-demo-${project.name}"
+ base {
+ archivesName = "openremote-demo-${project.name}"
+ }
from sourceSets.demo.output
}
diff --git a/ui/app/console_loader/build.gradle b/ui/app/console_loader/build.gradle
index ecd0dcdf2..867826d43 100644
--- a/ui/app/console_loader/build.gradle
+++ b/ui/app/console_loader/build.gradle
@@ -4,8 +4,8 @@ apply plugin: "signing"
sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
java {
diff --git a/ui/app/insights/build.gradle b/ui/app/insights/build.gradle
index c883d91a4..31f6cb79c 100644
--- a/ui/app/insights/build.gradle
+++ b/ui/app/insights/build.gradle
@@ -4,8 +4,8 @@ apply plugin: "signing"
sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
java {
diff --git a/ui/app/manager/build.gradle b/ui/app/manager/build.gradle
index 58be88184..b56bd221e 100644
--- a/ui/app/manager/build.gradle
+++ b/ui/app/manager/build.gradle
@@ -4,8 +4,8 @@ apply plugin: "signing"
sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
java {
diff --git a/ui/app/shared/build.gradle b/ui/app/shared/build.gradle
index 4b97f88aa..1d1afaaea 100644
--- a/ui/app/shared/build.gradle
+++ b/ui/app/shared/build.gradle
@@ -4,8 +4,8 @@ apply plugin: "signing"
sourceSets.main.resources.srcDirs += layout.buildDirectory.dir('classes/main')
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
java {
diff --git a/ui/app/swagger/build.gradle b/ui/app/swagger/build.gradle
index 808d893b6..f6d0c085b 100644
--- a/ui/app/swagger/build.gradle
+++ b/ui/app/swagger/build.gradle
@@ -12,8 +12,8 @@ dependencies {
sources "org.webjars:swagger-ui:$swaggeruiVersion"
}
-jar {
- archivesBaseName = "openremote-${project.name}"
+base {
+ archivesName = "openremote-${project.name}"
}
java {
diff --git a/ui/component/model/build.gradle b/ui/component/model/build.gradle
index 275e3f199..5b5c20f4c 100644
--- a/ui/component/model/build.gradle
+++ b/ui/component/model/build.gradle
@@ -1,7 +1,6 @@
buildscript {
repositories {
mavenCentral()
- jcenter()
}
dependencies {
classpath "cz.habarta.typescript-generator:typescript-generator-gradle-plugin:$typescriptGeneratorVersion"
diff --git a/ui/component/rest/build.gradle b/ui/component/rest/build.gradle
index b6fb063b2..233c32d8a 100644
--- a/ui/component/rest/build.gradle
+++ b/ui/component/rest/build.gradle
@@ -1,7 +1,6 @@
buildscript {
repositories {
mavenCentral()
- jcenter()
}
dependencies {
classpath "cz.habarta.typescript-generator:typescript-generator-gradle-plugin:$typescriptGeneratorVersion"