Skip to content

Commit

Permalink
fix(deps): Update and comment views-json-template deps (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei authored Apr 4, 2024
1 parent 9187db7 commit 166c13c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ groovy = '3.0.21'
java-baseline = '11'
javax-annotation-api = '1.3.2'
micronaut = '3.10.4'
mongodb = '4.11.1'
slf4j = '1.7.36'
spock = '2.3-groovy-3.0'
spring = '5.3.33'
Expand All @@ -37,6 +38,7 @@ groovy-json = { module = 'org.codehaus.groovy:groovy-json', version.ref = 'groov
groovy-templates = { module = 'org.codehaus.groovy:groovy-templates', version.ref = 'groovy' }
javax-annotation-api = { module = 'javax.annotation:javax.annotation-api', version.ref = 'javax-annotation-api' }
micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut' }
mongodb-bson = { module = 'org.mongodb:bson', version.ref = 'mongodb' }
slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j' }
slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j' }
spock-core = { module = 'org.spockframework:spock-core', version.ref = 'spock' }
Expand Down
16 changes: 10 additions & 6 deletions json-templates/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ dependencies {

api project(':views-json')

// Should this be api, implementation, compileOnly or provided?
// The templates expect classes from this library as models
// but I'm not sure in what context these templates are used
// They were previously compileOnly
compileOnly libs.grails.datastore.gorm.mongodb
// The templates in this project use classes from these dependencies so they should be in the implementation configuration.
//
// But, setting them as implementation will make grails apps using this project try to autoconfigure MongoDB beans,
// even without the real MongoDB dependencies on the classpath, which fails with ClassNotFoundExeption.
//
// Therefore, because this project is only supposed to work with MongoDB, setting them as compileOnly/provided is
// probably best, as it will not break apps that erroneously include this project as a dependency but don't use MongoDB.
compileOnly libs.grails.datastore.gorm.mongodb // provided
compileOnly libs.mongodb.bson // provided

compileOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during compileGsonViews task
}
Expand Down Expand Up @@ -52,4 +56,4 @@ apply from: rootProject.layout.projectDirectory.file('gradle/publishing.gradle')
// This is a workaround as a javadoc jar is required for publishing.
tasks.named('javadocJar', Jar) {
from 'src/templates'
}
}

0 comments on commit 166c13c

Please sign in to comment.