Skip to content
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

Update groovy 3 #590

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions checksum.xml
Expand Up @@ -75,6 +75,7 @@
<trusted-key id='411063a3a0ffd119' group='org.apache-extras.beanshell' />
<trusted-key id='87a7f75a6a8ba5fc' group='org.apache.activemq' />
<trusted-key id='bff2ee42c8282e76' group='org.apache.activemq' />
<trusted-key id='ddbcc1270a29d081' group='org.apache.ant' />
<trusted-key id='86fdc7e2a11262cb' group='org.apache.bcel' />
<trusted-key id='3faad2cd5ecbb314' group='org.apache.commons' />
<trusted-key id='64a16faaec16a4be' group='org.apache.commons' />
Expand Down Expand Up @@ -140,6 +141,7 @@
<trusted-key id='cfca4a29d26468de' group='org.sonarsource.scanner.api' />
<trusted-key id='cfca4a29d26468de' group='org.sonarsource.scanner.gradle' />
<trusted-key id='72fefd1572eb75e1' group='org.spockframework' />
<trusted-key id='af0a94402ea0a67f' group='org.spockframework' />
<trusted-key id='9a2c7a98e457c53d' group='org.springframework' />
<trusted-key id='e4b53844e02b191b' group='org.swinglabs' />
<trusted-key id='a2115ae15f6b8b72' group='org.xmlunit' />
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Expand Up @@ -74,7 +74,7 @@ freemarker.version=2.3.30
ftplet-api.version=1.1.1
ftpserver-core.version=1.1.1
geronimo-jms_1.1_spec.version=1.1.1
groovy-all.version=2.4.18
groovy.version=3.0.3
hamcrest.version=2.2
hamcrest-date.version=2.0.7
hsqldb.version=2.5.0
Expand Down Expand Up @@ -111,7 +111,7 @@ rhino.version=1.7.12
rsyntaxtextarea.version=3.1.0
Saxon-HE.version=9.9.1-7
slf4j.version=1.7.30
spock-core.version=1.2-groovy-2.4
spock-core.version=2.0-M2-groovy-3.0
springframework.version=4.3.17.RELEASE
svgSalamander.version=1.1.2.1
tika.version=1.23
Expand Down
2 changes: 1 addition & 1 deletion lib/aareadme.txt
Expand Up @@ -102,7 +102,7 @@ dnsjava-2.1.9
https://github.com/dnsjava/dnsjava
- DNSCacheManager

groovy-all-2.4.16
groovy-3.0.3
----------------------
Advised scripting language for JSR223 Test Elements

Expand Down
8 changes: 7 additions & 1 deletion src/bom/build.gradle.kts
Expand Up @@ -87,7 +87,13 @@ dependencies {
apiv("javax.mail:mail")
apiv("jcharts:jcharts")
apiv("junit:junit", "junit4")
apiv("org.codehaus.groovy:groovy-all")
apiv("org.codehaus.groovy:groovy", "groovy")
apiv("org.codehaus.groovy:groovy-datetime", "groovy")
apiv("org.codehaus.groovy:groovy-jmx", "groovy")
apiv("org.codehaus.groovy:groovy-json", "groovy")
apiv("org.codehaus.groovy:groovy-jsr223", "groovy")
apiv("org.codehaus.groovy:groovy-sql", "groovy")
apiv("org.codehaus.groovy:groovy-templates", "groovy")
Comment on lines +90 to +96
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please use org.codehaus.groovy:groovy-bom instead?

Suggested change
apiv("org.codehaus.groovy:groovy", "groovy")
apiv("org.codehaus.groovy:groovy-datetime", "groovy")
apiv("org.codehaus.groovy:groovy-jmx", "groovy")
apiv("org.codehaus.groovy:groovy-json", "groovy")
apiv("org.codehaus.groovy:groovy-jsr223", "groovy")
apiv("org.codehaus.groovy:groovy-sql", "groovy")
apiv("org.codehaus.groovy:groovy-templates", "groovy")
api(platform("org.codehaus.groovy:groovy-bom:${"groovy".v}"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That looks really nice, but when I try it out, it gives me the following error:

Build jmeter FAILURE reason:                                
    org.gradle.internal.exceptions.LocationAwareException: Build file '/home/felix/Developer/fschumacher-jmeter/src/bom/build.gradle.kts' line: 90
    Cannot convert the provided notation to an object of type DependencyConstraint: DefaultExternalModuleDependency{group='org.codehaus.groovy', name='groovy-bom', version='3.0.3', configuration='default'}.
    The following types/formats are supported:
      - Instances of DependencyConstraint.
      - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
      - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
      - Projects, for example project(':some:project:path').
      - Instances of ProjectDependency.
    
    Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.
        Caused by: org.gradle.internal.typeconversion.UnsupportedNotationException: Cannot convert the provided notation to an object of type DependencyConstraint: DefaultExternalModuleDependency{group='org.codehaus.groovy', name='groovy-bom', version='3.0.3', configuration='default'}.
        The following types/formats are supported:
          - Instances of DependencyConstraint.
          - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
          - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
          - Projects, for example project(':some:project:path').
          - Instances of ProjectDependency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh,

https://docs.gradle.org/current/userguide/java_platform_plugin.html#sec:java_platform_bom_import

So there should be the following before dependencies

javaPlatform {
    allowDependencies()
}

and api(platform(...)) should come in the dependencies section rather than dependencies { constraints { ... }}.

Can you please try that? (move api(platform before (constraints) {...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That works. Thanks for the hint.

apiv("org.junit.jupiter:junit-jupiter-api", "junit5")
apiv("org.junit.jupiter:junit-jupiter-params", "junit5")
runtimev("org.junit.jupiter:junit-jupiter-engine", "junit5")
Expand Down
7 changes: 6 additions & 1 deletion src/core/build.gradle.kts
Expand Up @@ -57,9 +57,14 @@ dependencies {
because("XPathUtil: throws SaxonApiException")
}

runtimeOnly("org.codehaus.groovy:groovy-all") {
runtimeOnly("org.codehaus.groovy:groovy") {
because("Groovy is a default JSR232 engine")
}
arrayOf("datetime", "jmx", "json", "jsr223", "sql", "templates").forEach {
runtimeOnly("org.codehaus.groovy:groovy-$it") {
because("Groovy is a default JSR232 engine")
}
}

implementation("com.fasterxml.jackson.core:jackson-annotations")
implementation("com.fasterxml.jackson.core:jackson-core")
Expand Down