You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by "jdaugherty (via GitHub)" <gi...@apache.org> on 2025/05/01 00:21:02 UTC
[PR] Wrapper & Profiles merge [grails-core]
jdaugherty opened a new pull request, #14684:
URL: https://github.com/apache/grails-core/pull/14684
This PR:
1. merges grails-wrapper & the `expanded` wrapper that contains all of the dependencies; since users use `grails-wrapper` I went with the project names `grails-wrapper` & `grails-wrapper-impl`
2. merges the profiles into the project
3. rewrites the profile gradle logic to be cacheable, lazy, & support inheritance via a 'profileRuntimeApi` scope
4. removes the existing functional tests - they need rewritten to be in gradle. We should open a bug ticket on this. We can revert 9b8fa17d when we're ready to work on this.
5. removes the groovy jmx library from shell - this was included so profiles had access, but as part of the gradle refactor, you can now include dependencies there. This may need added back to shell, but I think end projects should include the libraries they need to run the scripts they use instead of being included in the grails-shell-cli.
6. due to https://github.com/gradle/gradle/issues/2986 I did have to change the global dependency exclude, I spoke to @jamesfredley and we agreed to minimize it to '.gitignore' and '.gitkeep'
7. the shell scripts are checked in under grails-wrapper/shell are still used manually - well need to change the process that stages these scripts for the wrapper in end user projects. I believe these projects are `grails-profiles/base` and `grails-profiles/profile`. We should create a ticket for this work so that when base builds, it copies from the associated location.
8. gradlew scripts are checked in under some of the profiles, we should just copy the version grails uses to match what we expect to run with. We can take a similar approach, where we create a copy task in gradle that runs as part of build.
9. enhances the extract dependencies task to use the project property 'pomArtifactId' instead of the project name when generating the bom dependencies
10. some tests are now passing that have been previously been marked with PendingFeature and the annotation is removed
11. I have removed the external JS project specific profiles - vue, angular, react. These profiles are all extensions of the rest-api profile and this matches the forge decision to not include them. Otherwise, we would be maintaining them every time angular is upgraded.
@matrei would you be willing to do 7 or 8 above in a separate PR after this is merged?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Wrapper & Profiles merge [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #14684:
URL: https://github.com/apache/grails-core/pull/14684#issuecomment-2845495000
I'm going to go ahead and merge this for end-to-end testing and to get the license reports clean. We can revisit if anyone else has concerns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Wrapper & Profiles merge [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #14684:
URL: https://github.com/apache/grails-core/pull/14684
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Wrapper & Profiles merge [grails-core]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #14684:
URL: https://github.com/apache/grails-core/pull/14684#discussion_r2069707410
##########
grails-wrapper/src/main/java/grails/init/Start.java:
##########
@@ -0,0 +1,125 @@
+package grails.init;
+
+import grails.proxy.SystemPropertiesAuthenticator;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.net.Authenticator;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.file.Files;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
+//TODO: snapshot locations need supported
+public class Start {
+
+ private static final String PROJECT_NAME = "grails-wrapper-impl";
+ private static final String WRAPPER_PATH = "/org/apache/grails/" + PROJECT_NAME;
+ private static final String GRAILS_RELEASE_MAVEN_REPO_BASE_URL = "https://repo1.maven.org/maven2/";
+ private static final File WRAPPER_DIR = new File(System.getProperty("user.home") + "/.grails/wrapper");
+ private static final File NO_VERSION_JAR = new File(WRAPPER_DIR, PROJECT_NAME + ".jar");
+
+ private static String getMavenBaseUrl() {
+ String baseUrl = System.getProperty("grails.maven.repo.baseUrl");
+ if (baseUrl != null) {
+ return baseUrl;
+ }
+ baseUrl = System.getenv("GRAILS_RELEASE_MAVEN_REPO_BASE_URL");
+ if (baseUrl != null) {
+ return baseUrl;
+ }
+ return GRAILS_RELEASE_MAVEN_REPO_BASE_URL;
+ }
+
+ private static String getVersion() {
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ SAXParser saxParser = factory.newSAXParser();
+ FindReleaseHandler findReleaseHandler = new FindReleaseHandler();
+ final String mavenMetadataFileUrl = getMavenBaseUrl() + WRAPPER_PATH + "/maven-metadata.xml";
+ HttpURLConnection conn = createHttpURLConnection(mavenMetadataFileUrl);
+ saxParser.parse(conn.getInputStream(), findReleaseHandler);
Review Comment:
## Resolving XML external entity in user-controlled data
XML parsing depends on a [user-provided value](1) without guarding against external entity expansion.
[Show more details](https://github.com/apache/grails-core/security/code-scanning/20)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Wrapper & Profiles merge [grails-core]
Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #14684:
URL: https://github.com/apache/grails-core/pull/14684#issuecomment-2844021267
On https://github.com/apache/grails-core/pull/14686/files I am still working towards it properly loading the `org.apache.grails.profiles` profiles and correctly generating and app using them.
In working on that I ran into the following. I believe it exists on `rest-api-plugin` and `web-plugin`
```
Execution failed for task ':grails-profiles-rest-api-plugin:publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'mavenLocal'
> Invalid publication 'maven': artifact file does not exist: '\grails-core\grails-profiles\rest-api-plugin\build\classes\profile\META-INF\grails-profile\profile.yml'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Wrapper & Profiles merge [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #14684:
URL: https://github.com/apache/grails-core/pull/14684#issuecomment-2845352274
> There is an issue with publishMavenPublicationToMavenLocal on two of the profiles. I put it in a separate issue for now.
>
> #14687
>
> #14688 - issue to fix profile loading in grails-shell-cli
I fixed the publishing - those plugins do not have compiled code and the compile profile task was being used for 2 purposes. I probably should split the task, but for now I made it work in either case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org