pub fn parse(maven_coordinates: &str) -> Result<MavenCoordinates, &'static str> {
        debug!("Trying to parse Maven coordinates: {}", maven_coordinates);

        // Parse Maven coordinates into named capture groups, with optional packaging OR packaging+classifier
        let regexp = Regex::new(r"^(?P<groupId>[\w.\-]+):(?P<artifactId>[\w.\-]+)(?:(?::(?P<packaging>[\w.\-]+))(?::(?P<classifier>[\w.\-]+)?)?)?:(?P<version>[\w.\-]+)$")
            .expect("Error compiling regex");

        match regexp.captures(maven_coordinates) {
            Some(capture) => Ok(MavenCoordinates::new(
                capture
                    .name("groupId")
                    .map(|m| m.as_str())
                    .expect("Missing groupId"),
                capture
                    .name("artifactId")
                    .map(|m| m.as_str())
                    .expect("Missing artifactId"),
                capture.name("packaging").map(|m| m.as_str()),
                capture.name("classifier").map(|m| m.as_str()),
                capture
                    .name("version")
                    .map(|m| m.as_str())
                    .expect("Missing version"),
            )),
            None => Err("Couldn't parse Maven coordinates"),
        }
    }
/// Parse the Maven coordinates from a string.
///
/// # Examples
///
/// ```rust
/// use rvn::MavenCoordinates;
///
/// let coordinates = MavenCoordinates::parse("com.fasterxml.jackson.core:jackson-annotations:2.9.9").unwrap();
/// ```
Parse the Maven coordinates from a string.
Parse the Maven coordinates from a string .
pub fn parse(maven_coordinates: &str) -> Result<MavenCoordinates, &'static str> {
        debug!("Trying to parse Maven coordinates: {}", maven_coordinates);
        // Parse Maven coordinates into named capture groups, with optional packaging OR packaging+classifier
        let regexp = Regex::new(r"^(?P<groupId>[\w.\-]+):(?P<artifactId>[\w.\-]+)(?:(?::(?P<packaging>[\w.\-]+))(?::(?P<classifier>[\w.\-]+)?)?)?:(?P<version>[\w.\-]+)$")
            .expect("Error compiling regex");
        match regexp.captures(maven_coordinates) {
            Some(capture) => Ok(MavenCoordinates::new(
                capture
                    .name("groupId")
                    .map(|m| m.as_str())
                    .expect("Missing groupId"),
                capture
                    .name("artifactId")
                    .map(|m| m.as_str())
                    .expect("Missing artifactId"),
                capture.name("packaging").map(|m| m.as_str()),
                capture.name("classifier").map(|m| m.as_str()),
                capture
                    .name("version")
                    .map(|m| m.as_str())
                    .expect("Missing version"),
            )),
            None => Err("Couldn't parse Maven coordinates"),
        }
    }
pub fn parse ( maven_coordinates : & str ) -> Result < MavenCoordinates , & ' static str > { debug ! ( " " maven_coordinates ) ; // Parse Maven coordinates into named capture groups, with optional packaging OR packaging+classifier let regexp = Regex :: new ( r"^(?P<groupId>[\w.\-]+):(?P<artifactId>[\w.\-]+)(?:(?::(?P<packaging>[\w.\-]+))(?::(?P<classifier>[\w.\-]+)?)?)?:(?P<version>[\w.\-]+)$" ) . expect ( " " ) ; match regexp . captures ( maven_coordinates ) { Some ( capture ) => Ok ( MavenCoordinates :: new ( capture . name ( " " ) . map ( | m | m . as_str ( ) ) . expect ( " " ) , capture . name ( " " ) . map ( | m | m . as_str ( ) ) . expect ( " " ) , capture . name ( " " ) . map ( | m | m . as_str ( ) ) , capture . name ( " " ) . map ( | m | m . as_str ( ) ) , capture . name ( " " ) . map ( | m | m . as_str ( ) ) . expect ( " " ) , ) ) , None => Err ( " " ) , } }
Parse the Maven coordinates from a string.
Parse the Maven coordinates from a string .
maven_coordinates
&str
examples
```rust
use rvn::MavenCoordinates.

let coordinates = MavenCoordinates::parse("com.fasterxml.jackson.core:jackson-annotations:2.9.9").unwrap();
```
` ` ` rust use rvn :: MavenCoordinates . let coordinates = MavenCoordinates :: parse ( " com . fasterxml . jackson . core : jackson - annotations : 2 . 9 . 9 " ) . unwrap () ; ` ` `