You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2025/05/16 12:37:33 UTC

(grails-core) 04/06: Remove remaining pathing jar code

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

jdaugherty pushed a commit to branch corrupt-jar-fixes
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 2e737e292052619aca4f1be542e1bbabd066d48d
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Fri May 16 07:42:25 2025 -0400

    Remove remaining pathing jar code
---
 grails-doc/src/en/guide/commandLine.adoc           |  4 --
 .../guide/gettingStarted/aHelloWorldExample.adoc   |  2 -
 .../gradle/plugin/core/GrailsExtension.groovy      | 31 +++++-------
 .../views/AbstractGroovyTemplatePlugin.groovy      | 43 +++++-----------
 .../plugin/views/gsp/GroovyPagePlugin.groovy       | 57 +++++-----------------
 5 files changed, 36 insertions(+), 101 deletions(-)

diff --git a/grails-doc/src/en/guide/commandLine.adoc b/grails-doc/src/en/guide/commandLine.adoc
index c686d60751..83c7637d3b 100644
--- a/grails-doc/src/en/guide/commandLine.adoc
+++ b/grails-doc/src/en/guide/commandLine.adoc
@@ -234,10 +234,6 @@ dependencies {
     implementation 'org.grails:grails-core'
     // Add more dependencies as needed...
 }
-
-grails {
-    pathingJar = true
-}
 ----
 
 === Utilizing Gradle Build Tool
diff --git a/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc b/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
index 6744ec1bf4..50368b1ddb 100644
--- a/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
+++ b/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
@@ -184,8 +184,6 @@ Replace "9090" with your preferred port.
 
 === Note for Windows Users
 
-If you encounter an error related to the Java process or filename length, you can use the `--stacktrace` flag or add `grails { pathingJar = true }` to your "build.gradle" file.
-
 It may also be necessary to enclose the system properties in quotes on Windows:
 ----
 ./gradlew bootRun "-Dgrails.server.port=9090"
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
index 76da88a551..0e9b66228f 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
@@ -1,20 +1,18 @@
 /*
- *  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
+ *  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
  *
- *    https://www.apache.org/licenses/LICENSE-2.0
+ *      https://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.
+ *  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.
  */
 package org.grails.gradle.plugin.core
 
@@ -55,11 +53,6 @@ class GrailsExtension {
      */
     boolean exploded = true
 
-    /**
-     * Whether to create a jar file to reference the classpath to prevent classpath too long issues in Windows
-     */
-    boolean pathingJar = false
-
     /**
      * Whether java.time.* package should be a default import package
      */
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
index 44c7844421..00bbcc0361 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
@@ -1,20 +1,18 @@
 /*
- *  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
+ *  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
  *
- *    https://www.apache.org/licenses/LICENSE-2.0
+ *      https://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.
+ *  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.
  */
 
 package org.grails.gradle.plugin.views
@@ -22,18 +20,15 @@ package org.grails.gradle.plugin.views
 import grails.util.GrailsNameUtils
 import groovy.transform.CompileDynamic
 import groovy.transform.CompileStatic
-import org.apache.tools.ant.taskdefs.condition.Os
 import org.gradle.api.Plugin
 import org.gradle.api.Project
 import org.gradle.api.Task
-import org.gradle.api.file.ConfigurableFileCollection
 import org.gradle.api.file.Directory
 import org.gradle.api.file.FileCollection
 import org.gradle.api.provider.Provider
 import org.gradle.api.tasks.SourceSetOutput
 import org.gradle.api.tasks.TaskContainer
 import org.gradle.api.tasks.bundling.Jar
-import org.grails.gradle.plugin.core.GrailsExtension
 import org.grails.gradle.plugin.core.IntegrationTestGradlePlugin
 import org.grails.gradle.plugin.util.SourceSets
 
@@ -75,20 +70,6 @@ class AbstractGroovyTemplatePlugin implements Plugin<Project> {
         FileCollection classesDir = resolveClassesDirs(output, project)
         Provider<Directory> destDir = project.layout.buildDirectory.dir("${templateCompileTask.fileExtension.get()}-classes/main")
         output?.dir(destDir)
-        project.afterEvaluate {
-            GrailsExtension grailsExt = project.extensions.getByType(GrailsExtension)
-            if (grailsExt?.pathingJar && Os.isFamily(Os.FAMILY_WINDOWS)) {
-                Jar pathingJar = tasks.named('pathingJar', Jar).get()
-                ConfigurableFileCollection allClasspath = project.files(
-                        project.layout.buildDirectory.dir('classes/groovy/main'),
-                        project.layout.buildDirectory.dir('resources/main'),
-                        destDir,
-                        pathingJar.archiveFile
-                )
-                templateCompileTask.dependsOn(pathingJar)
-                templateCompileTask.classpath = allClasspath
-            }
-        }
         def allClasspath = classesDir + project.configurations.named('compileClasspath').get()
         templateCompileTask.destinationDirectory.set(destDir)
         templateCompileTask.classpath = allClasspath
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
index 770f88f534..6bf541257d 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
@@ -1,28 +1,24 @@
 /*
- *  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
+ *  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
  *
- *    https://www.apache.org/licenses/LICENSE-2.0
+ *      https://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.
+ *  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.
  */
 package org.grails.gradle.plugin.views.gsp
 
 import groovy.transform.CompileStatic
-import org.apache.tools.ant.taskdefs.condition.Os
 import org.gradle.api.Plugin
 import org.gradle.api.Project
-import org.gradle.api.file.ConfigurableFileCollection
 import org.gradle.api.file.Directory
 import org.gradle.api.file.DuplicatesStrategy
 import org.gradle.api.file.FileCollection
@@ -32,7 +28,6 @@ import org.gradle.api.tasks.SourceSetOutput
 import org.gradle.api.tasks.TaskContainer
 import org.gradle.api.tasks.bundling.Jar
 import org.gradle.api.tasks.bundling.War
-import org.grails.gradle.plugin.core.GrailsExtension
 import org.grails.gradle.plugin.util.SourceSets
 
 /**
@@ -82,28 +77,6 @@ class GroovyPagePlugin implements Plugin<Project> {
             it.classpath = allClasspath
         }
 
-        registerGrailsExtension(project)
-        project.afterEvaluate {
-            GrailsExtension grailsExt = project.extensions.getByType(GrailsExtension)
-            if (grailsExt.pathingJar && Os.isFamily(Os.FAMILY_WINDOWS)) {
-                Jar pathingJar = tasks.named('pathingJar', Jar).get()
-                ConfigurableFileCollection withPathingJarClasspath = project.files(
-                        project.layout.buildDirectory.dir('classes/groovy/main'),
-                        project.layout.buildDirectory.dir('resources/main'),
-                        destDir,
-                        pathingJar.archiveFile
-                )
-                compileGroovyPages.configure {
-                    it.dependsOn(pathingJar)
-                    it.classpath = withPathingJarClasspath.asFileTree
-                }
-                compileWebappGroovyPages.configure {
-                    it.dependsOn(pathingJar)
-                    it.classpath = withPathingJarClasspath.asFileTree
-                }
-            }
-        }
-
         compileGroovyPages.configure {
             it.dependsOn(
                     tasks.named('classes'),
@@ -142,12 +115,6 @@ class GroovyPagePlugin implements Plugin<Project> {
         }
     }
 
-    protected GrailsExtension registerGrailsExtension(Project project) {
-        if (project.extensions.findByName("grails") == null) {
-            project.extensions.add("grails", new GrailsExtension(project))
-        }
-    }
-
     protected FileCollection resolveClassesDirs(SourceSetOutput output, Project project) {
         output?.classesDirs ?: project.files(project.layout.buildDirectory.dir('classes/main'))
     }