[ 
https://issues.apache.org/jira/browse/MNG-7039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17239993#comment-17239993
 ] 

Matt Pavlovich edited comment on MNG-7039 at 11/28/20, 3:35 PM:
----------------------------------------------------------------

[~michael-o] I think having a Maven endorsed standard single string for the 
coordinate lends itself to really useful automation and identification. 
Uniformity will lead to convergence of dev-side and ops-side referencing to 
Maven deployed artifacts.

Apache Karaf uses a similar syntax for deploying jar artifacts and lends itself 
to being able to do commands like this:

{noformat}
> install mvn:com.company:foo-api:1.0.1-SNAPSHOT:jar
{noformat}


was (Author: mattrpav):
[~michael-o] I think having a Maven endorsed standard single string for the 
coordinate lends itself to really useful automation and identification. Apache 
Karaf uses a similar syntax for deploying jar artifacts and lends itself to 
being able to do commands like this:

{noformat}
> install mvn:com.company:foo-api:1.0.1-SNAPSHOT:jar
{noformat}

> [RFC] Reducing GAV verbosity by using URI syntax
> ------------------------------------------------
>
>                 Key: MNG-7039
>                 URL: https://issues.apache.org/jira/browse/MNG-7039
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Matt Pavlovich
>            Priority: Major
>
> Provide the ability to reference maven artifacts using a uri-like syntax 
> reduces verbosity.
> Reasoning:
> 1. The XML elements for groupId, artifactId, version, classifier and type are 
> never extended
> 2. Reducing lines of text improves maintenance of pom's
> 3. URI is a first-class citizen in XML schema and can be strongly typed, and 
> regex'd.
> 4. Maven GAV(CT) as a uri makes sense, since they are both coordinates of 
> sorts.
> 5. Addition of an attribute in the <dependency/> element allows for backwards 
> compatibility
> Challenges:
> 1. Requires the uri to be parsed for variable substitution (esp version)
> Option 1-- classifier and type as query params (probably more useful):
> {noformat}
> Given:
> <dependency>
>   <groupId>com.company</groupId>
>   <artifactId>foo-api</artifactId>
>   <version>1.0.1-SNAPSHOT</version>
>   <classifier>default</classifier>
>   <type>jar</jar>
>   <scope>compile</scope>
> </dependency>
> Maven 4.x feature:
> <dependency 
> uri="mvn:com.company/foo-api/1.0.1-SNAPSHOT?classifier=default&amp;type=jar" 
> scope="compile"/>
> w/ properties:
> <dependency 
> uri="mvn:com.company/foo-api/${project.version}?classifier=default&amp;type=jar"
>  scope="compile"/>
> -or urn style-
> <dependency 
> urn="mvn:com.company:foo-api:${project.version}?classifier=default&amp;type=jar"
>  scope="compile"/>
> {noformat}
> Option 2-- classifier and type as path params:
> {noformat}
> <dependency uri="mvn:com.company/foo-api/1.0.1-SNAPSHOT/default/jar" 
> scope="compile"/>
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to