Skip to content

Update plugin to use Apache Grails maven coordinates + other updates #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Enable auto-env through the sdkman_auto_env config - https://sdkman.io/usage#env
java=17.0.12-librca
java=17.0.15-librca
33 changes: 18 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
maven { url = "https://repository.apache.org/content/groups/snapshots/" }
maven { url = "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath platform("org.apache.grails:grails-bom:$grailsVersion")
classpath "org.apache.grails:grails-gradle-plugins"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle"
}
}

allprojects {
repositories {
maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
repositories {
mavenCentral()
maven { url = "https://repository.apache.org/content/groups/snapshots/" }
maven { url = 'https://repo.grails.org/grails/core' }
// mavenLocal() // for local testing, do not commit uncommented
}
}
}

version project.projectVersion
group "org.grails.plugins"
version = project.projectVersion
group = "org.grails.plugins"

subprojects { Project project ->
project.version project.projectVersion
project.group "org.grails.plugins"
project.version = project.projectVersion
project.group = "org.grails.plugins"

if(project.name.endsWith('audit-logging')) {
apply plugin: "org.grails.grails-publish"
apply plugin: "org.apache.grails.gradle.grails-publish"
grailsPublish {
githubSlug = 'grails-plugins/grails-audit-logging-plugin'
license {
name = 'Apache-2.0'
}
title = "Grails Audit-Logging Plugin"
desc = "Grails Audit-Logging Plugin for Grails 7+"
developers = [robertoschwald:"Robert Oschwald", longwa:"Aaron Long", elkr:"Elmar Kretzer"]
developers = [robertoschwald:"Robert Oschwald", longwa:"Aaron Long", elkr:"Elmar Kretzer",
jamesfredley:"James Fredley", jdaugherty:"James Daugherty"]
}
}
}

}
69 changes: 33 additions & 36 deletions examples/audit-test-allow-update-outside-transaction/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
}
}

plugins {
id "com.bertramlabs.asset-pipeline" version "$assetPipelineVersion"
}
version = project.projectVersion
group = 'audit.test'

version project.projectVersion
group "audit.test"

apply plugin: "war"
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: 'org.apache.grails.gradle.grails-web'
apply plugin: 'org.apache.grails.gradle.grails-gsp'
apply plugin: 'asset-pipeline'

assets {
minifyJs = true
Expand All @@ -33,38 +21,47 @@ configurations {
}

dependencies {
implementation platform("org.grails:grails-bom:$grailsVersion")
implementation platform("org.apache.grails:grails-bom:$grailsVersion")

implementation "org.apache.grails:grails-core"
implementation "org.apache.grails:grails-logging"
implementation "org.apache.grails:grails-databinding"
implementation "org.apache.grails:grails-i18n"
implementation "org.apache.grails:grails-interceptors"
implementation "org.apache.grails:grails-rest-transforms"
implementation "org.apache.grails:grails-services"
implementation "org.apache.grails:grails-url-mappings"
implementation "org.apache.grails:grails-web-boot"
implementation "org.apache.grails:grails-gsp"
implementation "org.apache.grails:grails-data-hibernate5"

implementation "org.hibernate:hibernate-ehcache:$hibernate5Version", {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to recommend ehcache by default; is this actually used in the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency was not listed in the build.gradle files, but was being loaded based on: https://github.com/grails-plugins/grails-audit-logging-plugin/blob/apache-coordinate-updates/examples/audit-test-allow-update-outside-transaction/grails-app/conf/application.yml#L80 which was putting the non-jakarta version of hibernate5 on the classpath and causing method not found errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// exclude javax variant of hibernate-core
exclude group: 'org.hibernate', module: 'hibernate-core'
}
implementation "org.jboss.spec.javax.transaction:jboss-transaction-api_1.3_spec:$jbossTransactionApiVersion", {
// required for hibernate-ehcache to work with javax variant of hibernate-core excluded
}

implementation "org.grails:grails-core"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-web-boot"
implementation "org.grails.plugins:gsp"
implementation "org.grails.plugins:hibernate5"
implementation "org.grails.plugins:scaffolding"
implementation "org.apache.grails:grails-scaffolding"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.springframework.boot:spring-boot-starter"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.springframework.boot:spring-boot-starter-validation"
console "org.grails:grails-console"
console "org.apache.grails:grails-console"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "org.fusesource.jansi:jansi"
integrationTestImplementation testFixtures("org.grails.plugins:geb")
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
integrationTestImplementation testFixtures("org.apache.grails:grails-geb")
testImplementation "org.apache.grails:grails-testing-support-datamapping"
testImplementation "org.apache.grails:grails-testing-support-web"
testImplementation "org.spockframework:spock-core"

implementation project(":audit-logging")
profile "org.grails.profiles:web"
profile "org.apache.grails.profiles:web"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ environments:
dataSource:
dbCreate: "create-drop"
url: "jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
dataSources:
second:
dbCreate: "update"
url: "jdbc:h2:mem:testDb2;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
test:
dataSource:
dbCreate: "update"
Expand Down
69 changes: 33 additions & 36 deletions examples/audit-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
}
}

plugins {
id "com.bertramlabs.asset-pipeline" version "$assetPipelineVersion"
}
version = project.projectVersion
group = 'audit.test'

version project.projectVersion
group "audit.test"

apply plugin: "war"
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: 'org.apache.grails.gradle.grails-web'
apply plugin: 'org.apache.grails.gradle.grails-gsp'
apply plugin: 'asset-pipeline'

assets {
minifyJs = true
Expand All @@ -34,39 +22,48 @@ configurations {

dependencies {

implementation platform("org.grails:grails-bom:$grailsVersion")
implementation platform("org.apache.grails:grails-bom:$grailsVersion")

developmentOnly "org.springframework.boot:spring-boot-devtools"
implementation "org.grails:grails-core"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-web-boot"
implementation "org.grails.plugins:gsp"
implementation "org.grails.plugins:hibernate5"
implementation "org.grails.plugins:scaffolding"
implementation "org.apache.grails:grails-core"
implementation "org.apache.grails:grails-logging"
implementation "org.apache.grails:grails-databinding"
implementation "org.apache.grails:grails-i18n"
implementation "org.apache.grails:grails-interceptors"
implementation "org.apache.grails:grails-rest-transforms"
implementation "org.apache.grails:grails-services"
implementation "org.apache.grails:grails-url-mappings"
implementation "org.apache.grails:grails-web-boot"
implementation "org.apache.grails:grails-gsp"
implementation "org.apache.grails:grails-data-hibernate5"

implementation "org.hibernate:hibernate-ehcache:$hibernate5Version", {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// exclude javax variant of hibernate-core
exclude group: 'org.hibernate', module: 'hibernate-core'
}
implementation "org.jboss.spec.javax.transaction:jboss-transaction-api_1.3_spec:$jbossTransactionApiVersion", {
// required for hibernate-ehcache to work with javax variant of hibernate-core excluded
}

implementation "org.apache.grails:grails-scaffolding"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.springframework.boot:spring-boot-starter"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.springframework.boot:spring-boot-starter-validation"
console "org.grails:grails-console"
console "org.apache.grails:grails-console"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "org.fusesource.jansi:jansi"
integrationTestImplementation testFixtures("org.grails.plugins:geb")
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
integrationTestImplementation testFixtures("org.apache.grails:grails-geb")
testImplementation "org.apache.grails:grails-testing-support-datamapping"
testImplementation "org.apache.grails:grails-testing-support-web"
testImplementation "org.spockframework:spock-core"

implementation project(":audit-logging")
profile "org.grails.profiles:web"
profile "org.apache.grails.profiles:web"
}

tasks.withType(Test).configureEach { Task it ->
Expand Down
4 changes: 2 additions & 2 deletions examples/audit-test/grails-app/views/error.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<g:if test="${Throwable.isInstance(exception)}">
<g:renderException exception="${exception}" />
</g:if>
<g:elseif test="${request.getAttribute('javax.servlet.error.exception')}">
<g:renderException exception="${request.getAttribute('javax.servlet.error.exception')}" />
<g:elseif test="${request.getAttribute('jakarta.servlet.error.exception')}">
<g:renderException exception="${request.getAttribute('jakarta.servlet.error.exception')}" />
</g:elseif>
<g:else>
<ul class="errors">
Expand Down
61 changes: 0 additions & 61 deletions flake.lock

This file was deleted.

21 changes: 0 additions & 21 deletions flake.nix

This file was deleted.

10 changes: 7 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
projectVersion=6.0.0-SNAPSHOT

asciidoctorJvmVersion=4.0.3
assetPipelineVersion=5.0.5
grailsVersion=7.0.0-M1
grailsGradlePluginVersion=7.0.0-SNAPSHOT
customUserDataVersion=2.2.1
develocityVersion=4.0
grailsVersion=7.0.0-SNAPSHOT

#For tests only
hibernate5Version=5.6.15.Final
jbossTransactionApiVersion=2.0.0.Final

org.gradle.daemon=true
org.gradle.parallel=true
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading