launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32831
[Merge] ~ruinedyourlife/launchpad:maven-explanation-and-logs into launchpad:master
Quentin Debhi has proposed merging ~ruinedyourlife/launchpad:maven-explanation-and-logs into launchpad:master.
Commit message:
Explain maven repo configuration & output maven logs for errors
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~ruinedyourlife/launchpad/+git/launchpad/+merge/490254
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~ruinedyourlife/launchpad:maven-explanation-and-logs into launchpad:master.
diff --git a/lib/lp/crafts/model/craftrecipebuildjob.py b/lib/lp/crafts/model/craftrecipebuildjob.py
index 0afc460..f1aec52 100644
--- a/lib/lp/crafts/model/craftrecipebuildjob.py
+++ b/lib/lp/crafts/model/craftrecipebuildjob.py
@@ -479,9 +479,8 @@ class CraftPublishingJob(CraftRecipeBuildJobDerived):
)
if result.returncode != 0:
- raise Exception(
- f"Failed to publish Maven artifact: {result.stderr}"
- )
+ log.error(f"[+] Maven publish stdout:\n{result.stdout}")
+ raise Exception("Failed to publish Maven artifact")
self._publish_properties(maven_publish_url, artifact_name)
diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
index c9527c2..4c8c713 100644
--- a/lib/lp/services/config/schema-lazr.conf
+++ b/lib/lp/services/config/schema-lazr.conf
@@ -307,47 +307,56 @@ scan_malware: False
#
# PULLING FROM ARTIFACTORY
#
-# The following variables can be adjusted to use different Artifactory repositories:
+# For Cargo, we use the standard Cargo registry environment variables.
+# We can define multiple Cargo registries, but we only use one for now.
#
-# - CARGO_ARTIFACTORY1_URL: URL of the Cargo registry to publish to
-# - CARGO_ARTIFACTORY1_READ_AUTH: Authentication credentials for the Cargo registry
-# - MAVEN_ARTIFACTORY1_URL: URL of the Maven repository to publish to
-# - MAVEN_ARTIFACTORY1_READ_AUTH: Authentication credentials for the Maven repository
+# For Maven, we use a simplified single repository approach where all
+# dependencies are resolved through a single Artifactory virtual repository.
+# This virtual repository should be configured to proxy Maven Central and
+# contain any custom artifacts.
#
-# Note: Cargo and Maven variables are automatically transformed by buildd during build setup.
-#
-# For Cargo specifically, CARGO_* variables above are converted into proper Cargo registry environment variables:
+# The following variables are required for Maven dependency resolution:
+# - MAVEN_REPO_URL: URL of the single Maven virtual repository for all
+# dependencies
+# - MAVEN_REPO_AUTH: Authentication credentials for the Maven repository
+#
+# For Cargo specifically, CARGO_* variables are converted into proper Cargo
+# registry environment variables:
# CARGO_ARTIFACTORY1_URL -> CARGO_REGISTRIES_ARTIFACTORY1_INDEX
# CARGO_ARTIFACTORY1_READ_AUTH -> CARGO_REGISTRIES_ARTIFACTORY1_TOKEN (with "Bearer " prefix)
-# The registry name (e.g., "ARTIFACTORY1") must be embedded in the variable name so that
-# Cargo can properly map the credentials to the correct registry. This transformation allows
-# Cargo to authenticate with private registries using the standard
-# CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS=cargo:token mechanism.
-# Users must activate the desired profile in their command line (typically done inside sourcecraft.yaml).
+# The registry name (e.g., "ARTIFACTORY1") must be embedded in the variable name
+# so that Cargo can properly map the credentials to the correct registry. This
+# transformation allows Cargo to authenticate with private registries using the
+# standard CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS=cargo:token mechanism.
+# Users must activate the desired source in their command line (typically done
+# inside sourcecraft.yaml).
# https://doc.rust-lang.org/cargo/reference/config.html#registriesnamecredential-provider
# https://doc.rust-lang.org/cargo/reference/registry-authentication.html
#
# For Cargo pulling, the following variables is required:
# - CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS: "cargo:token"
#
-# For Maven specifically, MAVEN_* variables are converted into Maven settings.xml configuration:
-# - Creates server configurations for authentication using MAVEN_*_READ_AUTH credentials
-# - Defines both release and snapshot repositories from MAVEN_*_URL variables
-# - Sets up profile configurations for each repository with proper snapshot behavior
-# - Configures mirror settings to redirect all repository requests through Artifactory
-# - Generates plugin repository configurations with authentication
-# The resulting settings.xml allows Maven to authenticate with private repositories,
-# use correct URLs for artifacts, handle both release and snapshot dependencies,
-# and use plugin repositories with authentication. Users must activate the desired
-# profile in their command line (typically done inside sourcecraft.yaml).
+# For Maven specifically, the MAVEN_* variables are converted into Maven
+# settings.xml configuration:
+# - Creates server configurations for authentication using MAVEN_REPO_AUTH
+# credentials
+# - Defines a single repository and pluginRepository pointing to MAVEN_REPO_URL
+# - Configures mirror settings to redirect all repository requests through the
+# single Artifactory repo
+# - Generates plugin repository configurations with authentication The resulting
+# settings.xml allows Maven to authenticate with the single Artifactory
+# repository, use the correct URL for all artifacts and use plugin repositories
+# with authentication.
#
# example:
# environment_variables: {
-# "CARGO_ARTIFACTORY1_URL": "https://canonical.example.com/artifactory/api/cargo/cargo-upstream/index/",
+# "CARGO_ARTIFACTORY1_URL": "https://canonical.example.com/artifactory/api/cargo/cargo-upstream-1/index/",
# "CARGO_ARTIFACTORY1_READ_AUTH": "%(read_auth)s",
+# "CARGO_ARTIFACTORY2_URL": "https://canonical.example.com/artifactory/api/cargo/cargo-upstream-2/index/",
+# "CARGO_ARTIFACTORY2_READ_AUTH": "%(read_auth)s",
# "CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS": "cargo:token",
-# "MAVEN_ARTIFACTORY1_URL": "https://canonical.example.com/artifactory/api/maven/maven-upstream/index",
-# "MAVEN_ARTIFACTORY1_READ_AUTH": "%(read_auth)s",
+# "MAVEN_REPO_URL": "https://canonical.example.com/artifactory/maven-virtual-repo",
+# "MAVEN_REPO_AUTH": "%(read_auth)s",
# }
#
# PUBLISHING TO ARTIFACTORY
@@ -362,7 +371,7 @@ scan_malware: False
# For Cargo publishing, the following variables are required:
# - CARGO_PUBLISH_URL: URL of the Cargo registry to publish to
# - CARGO_PUBLISH_AUTH: Authentication token for the Cargo registry
-environment_variables: none
+environment_variables: none
[codebrowse]
Follow ups