You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/02/10 21:41:00 UTC

[jira] [Closed] (GROOVY-10739) Improve error message for malformed grab coordinate

     [ https://issues.apache.org/jira/browse/GROOVY-10739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-10739.
------------------------------

> Improve error message for malformed grab coordinate
> ---------------------------------------------------
>
>                 Key: GROOVY-10739
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10739
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 4.0.5, 2.5.19, 3.0.13
>
>
> Here is an example using Grapes to download a matrix library:
> {code:java}
> @Grab('org.ejml:ejml-simple:0.41')
> import org.ejml.simple.SimpleMatrixdef m = new SimpleMatrix([[1d, 1d], [1d, 0d]] as double[][])
> def ans = m.mult(m).mult(m)
> println ans
> {code}
> If we have a typo, e.g. in the organisation, and use 'org/ejml' instead of 'org.ejml', we will get an error of the form:
> {noformat}
> Error grabbing Grapes -- [unresolved dependency...error details...]
> {noformat}
> With the error details differing depending on where our typo occurs.
> However, currently we get the error only after the download process fails to find the artifact or Ivy complains at some point. We can fail early and provide a better error message without incurring network calls or calls into Ivy. I propose to follow similar rules to Maven coordinate validation:
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java#L76
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java#L901



--
This message was sent by Atlassian Jira
(v8.20.10#820010)