Skip to content

Commit 9a6dd39

Browse files
authored
Merge branch '7.0.x' into docs/configuration-hybrid
2 parents 242b1d5 + b0dc6d6 commit 9a6dd39

6 files changed

Lines changed: 77 additions & 12 deletions

File tree

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ext {
3737
'jna.version' : '5.17.0',
3838
'jquery.version' : '3.7.1',
3939
'objenesis.version' : '3.4',
40-
'spring-boot.version' : '3.5.11',
40+
'spring-boot.version' : '3.5.13',
4141
]
4242

4343
// Note: the name of the dependency must be the prefix of the property name so properties in the pom are resolved correctly

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
734734
it.dependsOn(project.tasks.named('compileGroovy', GroovyCompile), project.tasks.named('classes'))
735735
it.mustRunAfter(project.tasks.named('classes'))
736736
it.mainClassCacheFile.set(mainClassFileContainer)
737-
it.outputs.upToDateWhen {
738-
mainClassFileContainer.orNull?.asFile?.exists()
739-
}
740737
}
741738

742739
project.afterEvaluate {

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class GroovyPagePlugin implements Plugin<Project> {
5555
SourceSetOutput output = mainSourceSet?.output
5656
FileCollection classesDirs = resolveClassesDirs(output, project)
5757
Provider<Directory> destDir = project.layout.buildDirectory.dir('gsp-classes/main')
58+
Provider<Directory> webappDestDir = project.layout.buildDirectory.dir('gsp-classes/webapp')
5859
output?.dir('gsp-classes')
5960

6061
FileCollection allClasspath = project.getObjects().fileCollection().from(
@@ -75,7 +76,7 @@ class GroovyPagePlugin implements Plugin<Project> {
7576
}
7677

7778
def compileWebappGroovyPages = tasks.register('compileWebappGroovyPages', GroovyPageForkCompileTask) {
78-
it.destinationDirectory.set(destDir)
79+
it.destinationDirectory.set(webappDestDir)
7980
it.source = project.layout.projectDirectory.dir('src/main/webapp')
8081
it.tmpDirPath = getTmpDirPath(project)
8182
it.serverpath.set('/')
@@ -96,14 +97,18 @@ class GroovyPagePlugin implements Plugin<Project> {
9697
war.from(destDir) { CopySpec it ->
9798
it.into('WEB-INF/classes')
9899
}
100+
war.from(webappDestDir) { CopySpec it ->
101+
it.into('WEB-INF/classes')
102+
}
99103
} else if (war.name == 'war') {
100104
war.from(destDir)
105+
war.from(webappDestDir)
101106
}
102107

103108
if (war.classpath) {
104-
war.classpath = war.classpath + project.files(destDir)
109+
war.classpath = war.classpath + project.files(destDir, webappDestDir)
105110
} else {
106-
war.classpath = project.files(destDir)
111+
war.classpath = project.files(destDir, webappDestDir)
107112
}
108113
}
109114

@@ -115,8 +120,12 @@ class GroovyPagePlugin implements Plugin<Project> {
115120
jar.from(destDir) { CopySpec it ->
116121
it.into('BOOT-INF/classes')
117122
}
123+
jar.from(webappDestDir) { CopySpec it ->
124+
it.into('BOOT-INF/classes')
125+
}
118126
} else if (jar.name == 'jar') {
119127
jar.from(destDir)
128+
jar.from(webappDestDir)
120129
}
121130
}
122131
}

grails-gradle/tasks/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ abstract class FindMainClassTask extends DefaultTask {
9393
@TaskAction
9494
void setMainClassProperty() {
9595
File cacheFile = mainClassCacheFile.get().asFile
96-
if (cacheFile.exists()) {
97-
// the only time this task should invoke is when gradle has deemed it necessary to run, always remove the
98-
// the cache file to prevent invalid states when running tasks other than bootRun, bootJar, or bootWar
99-
cacheFile.delete()
100-
}
10196

10297
if (mainClassName.isPresent()) {
10398
def overrideClassName = mainClassName.get()
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package functionaltests
20+
21+
import spock.lang.Specification
22+
23+
import grails.testing.mixin.integration.Integration
24+
import org.apache.grails.testing.http.client.HttpClientSupport
25+
26+
@Integration
27+
class GspInWebappDirSpec extends Specification implements HttpClientSupport {
28+
29+
def 'GSP in src/main/webapp renders'() {
30+
when:
31+
def response = http('/gsp-in-webapp-dir.gsp')
32+
33+
then:
34+
response.assertContains(200, 'Hello from GSP in src/main/webapp')
35+
}
36+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<%--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
--%>
19+
<%@ page contentType="text/html;charset=UTF-8" %>
20+
<html>
21+
<head>
22+
<title>Testing GSP in src/main/webapp directory</title>
23+
</head>
24+
25+
<body>
26+
<h1>Hello from GSP in src/main/webapp</h1>
27+
</body>
28+
</html>

0 commit comments

Comments
 (0)