pub struct DependencyConfig {
pub name: String,
pub group_id: Option<String>,
pub artifact_id: Option<String>,
pub version: String,
pub registry: String,
pub output_path: String,
pub resolve_references: Option<bool>,
}Expand description
Dependency configuration for artifacts to fetch from registries
Dependencies support semantic version ranges and are resolved to exact versions in the lock file for reproducible builds.
Smart resolution is supported for group_id and artifact_id:
- If
nameis in “group/artifact” format, group_id defaults to “group” and artifact_id to “artifact” - If
nameis simple, group_id defaults to “default” and artifact_id to the name - Explicit
group_idandartifact_idoverride the smart defaults
Fields§
§name: StringLocal name/alias for this dependency (supports group/artifact format for smart resolution)
group_id: Option<String>Group ID of the artifact in the registry (optional - resolved from name if not provided)
artifact_id: Option<String>Artifact ID in the registry (optional - resolved from name if not provided)
version: StringVersion specification (supports semver ranges like ^1.0.0, ~2.1.0)
registry: StringName of the registry to fetch from (must match a registry name)
output_path: StringLocal path where the artifact should be saved
resolve_references: Option<bool>Override reference resolution for this specific dependency
Implementations§
Source§impl DependencyConfig
impl DependencyConfig
Sourcepub fn resolved_group_id(&self) -> String
pub fn resolved_group_id(&self) -> String
Get the resolved group ID for this dependency configuration
If group_id is explicitly set, uses that value. Otherwise:
- If
namecontains ‘/’, uses the part before ‘/’ as group ID - Otherwise defaults to “default”
§Examples
- name: “com.example/my-service” → group_id: “com.example”
- name: “my-service” → group_id: “default”
Sourcepub fn resolved_artifact_id(&self) -> String
pub fn resolved_artifact_id(&self) -> String
Get the resolved artifact ID for this dependency configuration
If artifact_id is explicitly set, uses that value. Otherwise:
- If
namecontains ‘/’, uses the part after ‘/’ as artifact ID - Otherwise uses the entire
nameas artifact ID
§Examples
- name: “com.example/my-service” → artifact_id: “my-service”
- name: “my-service” → artifact_id: “my-service”
Trait Implementations§
Source§impl Clone for DependencyConfig
impl Clone for DependencyConfig
Source§fn clone(&self) -> DependencyConfig
fn clone(&self) -> DependencyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more