You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2026/08/10 18:41:38 UTC

(freemarker-online-tester) 02/03: Gradle: Migrated to use version catalog

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch java17
in repository https://gitbox.apache.org/repos/asf/freemarker-online-tester.git

commit f628521302f385eff9fba19c1c4b5b6941cad72c
Author: ddekany <dd...@apache.org>
AuthorDate: Mon Aug 10 19:43:17 2026 +0200

    Gradle: Migrated to use version catalog
---
 build.gradle                   | 33 +++++++++++++--------------
 dependencies.gradle            | 52 ------------------------------------------
 gradle/libs.versions.toml      | 30 ++++++++++++++++++++++++
 gradle/repositories.gradle.kts | 45 ------------------------------------
 4 files changed, 46 insertions(+), 114 deletions(-)

diff --git a/build.gradle b/build.gradle
index f54d349..6452e16 100644
--- a/build.gradle
+++ b/build.gradle
@@ -23,7 +23,6 @@ version = "0.1-SNAPSHOT"
 ext.jarName = "${project.name}-${project.version}"
 
 apply from: "intellij.gradle"
-apply from: "${rootDir}/dependencies.gradle"
 apply plugin: 'maven-publish'
 apply plugin: 'java'
 apply plugin: 'jacoco'
@@ -62,22 +61,22 @@ configurations {
 }
 
 dependencies {
-    implementation libraries.dropwizard
-    implementation libraries.dropwizard_views
-    implementation libraries.dropwizard_views_freemarker
-    implementation libraries.dropwizard_configurable_assets
-    implementation libraries.dropwizard_bundles_redirect
-    implementation libraries.freemarker
-    implementation libraries.commonLangs
-    implementation libraries.findBugs
-
-    testImplementation libraries.dropwizard_testing
-    testImplementation libraries.junit
-    testImplementation libraries.mockito
-    testImplementation libraries.hamcrest
-    testImplementation libraries.jersey_grrizle
-    
-    rat libraries.rat
+    implementation libs.dropwizard
+    implementation libs.dropwizard.views
+    implementation libs.dropwizard.views.freemarker
+    implementation libs.dropwizard.configurable.assets
+    implementation libs.dropwizard.bundles.redirect
+    implementation libs.freemarker
+    implementation libs.commons.lang3
+    implementation libs.findbugs
+
+    testImplementation libs.dropwizard.testing
+    testImplementation libs.junit
+    testImplementation libs.mockito
+    testImplementation libs.hamcrest
+    testImplementation libs.jersey.grrizle
+
+    rat libs.rat
 }
 
 compileJava {
diff --git a/dependencies.gradle b/dependencies.gradle
deleted file mode 100644
index cbcd6e0..0000000
--- a/dependencies.gradle
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-ext.dropwizard_version = "2.1.12";
-ext.jersey_version = "2.41"; // Keep in sync with dropwizard jersey dependency!
-
-ext.libraries = [
-        // Dropwizard:
-        dropwizard: "io.dropwizard:dropwizard-core:$dropwizard_version",
-        dropwizard_client: "io.dropwizard:dropwizard-client:$dropwizard_version",
-        dropwizard_views: "io.dropwizard:dropwizard-views:$dropwizard_version",
-        dropwizard_views_freemarker: "io.dropwizard:dropwizard-views-freemarker:$dropwizard_version",
-        dropwizard_assets: "io.dropwizard:dropwizard-assets:$dropwizard_version",
-        dropwizard_configurable_assets: "io.dropwizard-bundles:dropwizard-configurable-assets-bundle:1.0.5",
-        dropwizard_bundles_redirect: "io.dropwizard-bundles:dropwizard-redirect-bundle:1.2.2",
-
-        // App. specific:
-        freemarker: "org.freemarker:freemarker:2.3.34",
-        jersey_core: "org.glassfish.jersey.core:jersey-core:$jersey_version",
-
-        // Commons:
-        findBugs: "com.google.code.findbugs:annotations:3.0.0",
-        commonLangs: "org.apache.commons:commons-lang3:3.7",
-        guava: "com.google.guava:guava:24.1-jre",
-
-        // Test:
-        dropwizard_testing: "io.dropwizard:dropwizard-testing:$dropwizard_version",
-        dropwizard_client: "io.dropwizard:dropwizard-client:$dropwizard_version",
-        junit: "junit:junit:4.12",
-        mockito: "org.mockito:mockito-core:5.23.0",
-        hamcrest: "org.hamcrest:hamcrest-library:3.0",
-        jersey_grrizle: "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:$jersey_version",
-        
-        // Build:
-        rat: "org.apache.rat:apache-rat-tasks:0.18"
-]
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..d5b75c5
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,30 @@
+[versions]
+
+dropwizard = "2.1.12"
+jersey = "2.41"
+freemarker = "2.3.34"
+
+[libraries]
+
+# Dropwizard:
+dropwizard = { module = "io.dropwizard:dropwizard-core", version.ref = "dropwizard" }
+dropwizard-views-freemarker = { module = "io.dropwizard:dropwizard-views-freemarker", version.ref = "dropwizard" }
+dropwizard-configurable-assets = "io.dropwizard-bundles:dropwizard-configurable-assets-bundle:1.0.5"
+dropwizard-bundles-redirect = "io.dropwizard-bundles:dropwizard-redirect-bundle:1.2.2"
+
+# App. specific:
+freemarker = { module = "org.freemarker:freemarker", version.ref = "freemarker" }
+
+# Test:
+dropwizard-testing = { module = "io.dropwizard:dropwizard-testing", version.ref = "dropwizard" }
+junit = "junit:junit:4.13.2"
+mockito = "org.mockito:mockito-core:5.23.0"
+hamcrest = "org.hamcrest:hamcrest-library:3.0"
+jersey-grrizle = { module = "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2", version.ref = "jersey" }
+
+# Commons:
+commons-lang3 = "org.apache.commons:commons-lang3:3.20.0"
+
+# Build:
+findbugs = "com.google.code.findbugs:annotations:3.0.0"
+rat = "org.apache.rat:apache-rat-tasks:0.18"
diff --git a/gradle/repositories.gradle.kts b/gradle/repositories.gradle.kts
deleted file mode 100644
index dcf15f3..0000000
--- a/gradle/repositories.gradle.kts
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-fun RepositoryHandler.configurePluginRepositories() {
-    maven {
-        setUrl("https://repository.apache.org/content/groups/public")
-        mavenContent {
-            includeGroup("org.apache.freemarker.docgen")
-        }
-    }
-    gradlePluginPortal()
-    mavenCentral()
-}
-
-fun RepositoryHandler.configureMainRepositories() {
-    mavenCentral()
-}
-
-pluginManagement.repositories.configurePluginRepositories()
-
-dependencyResolutionManagement {
-    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
-
-    if (rootDir.name == "buildSrc") {
-        repositories.configurePluginRepositories()
-    } else {
-        repositories.configureMainRepositories()
-    }
-}