[
https://issues.apache.org/jira/browse/GROOVY-12374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112148#comment-18112148
]
ASF GitHub Bot commented on GROOVY-12374:
-----------------------------------------
codecov-commenter commented on PR #2897:
URL: https://github.com/apache/groovy/pull/2897#issuecomment-5565119996
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2897?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 71.1277%. Comparing base
([`5b75e21`](https://app.codecov.io/gh/apache/groovy/commit/5b75e21feb99a5676f24c3dde932af1ffae9a578?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`f68254b`](https://app.codecov.io/gh/apache/groovy/commit/f68254bae6cefed819eb9c1cb3ee58b3ca948c0a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 6 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2897?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2897 +/- ##
==================================================
+ Coverage 71.1240% 71.1277% +0.0037%
- Complexity 37493 37498 +5
==================================================
Files 1579 1579
Lines 135777 135777
Branches 25174 25174
==================================================
+ Hits 96570 96575 +5
+ Misses 30506 30504 -2
+ Partials 8701 8698 -3
```
[see 9 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2897/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests,
report on failures, and find test suite problems.
- :package: [JS Bundle
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save
yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
> Launchers: match java classpath semantics — no implicit . when -cp is set
> -------------------------------------------------------------------------
>
> Key: GROOVY-12374
> URL: https://issues.apache.org/jira/browse/GROOVY-12374
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Priority: Major
>
> h2. Problem
> The launcher scripts ({{startGroovy}} / {{startGroovy.bat}}) always append
> the current directory ({{.}}) to the classpath, in every branch -- including
> when an explicit {{-cp}}/{{-classpath}} option or the {{CLASSPATH}}
> environment variable is supplied:
> {code:bash}
> if [ -n "$CP" ] ; then
> CP="$CP":.
> elif [ -n "$CLASSPATH" ] ; then
> CP="$CLASSPATH":.
> else
> CP=.
> fi
> {code}
> This has two problems:
> * It diverges from the {{java}} interpreter, which does *not* add {{.}} when
> a classpath is given ({{java -cp foo Main}} uses only {{foo}}). It also
> contradicts the launcher's own comment, which claims {{-cp}} behaves "the
> same as the java interpreter".
> * It places the current working directory on the classpath of *every* Groovy
> command, so running a tool from a directory containing a stray {{.class}} can
> load it -- an untrusted-search-path footgun (CWE-427).
> h2. Change
> An explicit {{-cp}}/{{-classpath}} option, or the {{CLASSPATH}} environment
> variable, is now honoured as-is. Only a bare invocation with no classpath
> given falls back to the current directory, matching {{java}}/{{javac}}.
> Applied uniformly across both launchers ({{startGroovy}} and
> {{startGroovy.bat}}), and therefore to {{groovy}}, {{groovyc}}, {{groovysh}},
> {{groovyConsole}}, and the rest.
> h2. Compatibility
> * The common "cd into a project and run" workflow is *unchanged*: a bare
> {{groovy MyScript.groovy}} still puts the current directory on the classpath,
> so sibling scripts, classes and resources resolve as before.
> * The only behaviour change: {{groovy -cp lib.jar MyScript}} no longer
> silently adds {{.}} as well. Anyone relying on that must include it
> explicitly -- {{-cp lib.jar:.}} (Unix) or {{-cp lib.jar;.}} (Windows) --
> exactly as {{java}} has always required.
> Being a behaviour change to the launchers, this is targeted at 6.0.
> Documented in the command-line tools user guide.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)