plugins/aem/cloud-service/skills/code-assessment/remove-deprecated-api/SKILL.md
[BETA] AEM Cloud Service expert skill — migrate deprecated and removed Java imports, Maven dependencies, and unmodifiable OSGi configs to comply with AEM as a Cloud Service enforcement policies. Use when auditing deprecated APIs, fixing Cloud Manager pipeline failures due to deprecated API usage ("api-regions-check", "Import-Package" violations), or proactively modernizing AEM projects before enforcement deadlines. Covers log4j migration, commons-lang / commons-collections v2→v3 upgrades, Guava removal, import replacements (org.eclipse.jetty, com.mongodb, ch.qos.logback, com.drew, etc.), Maven dependency cleanup, and removal of unmodifiable OSGi PID configurations. This skill is in beta. Verify all outputs before applying them to production projects.
npx skillsauth add adobe/skills remove-deprecated-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Beta Skill: This skill is in beta and under active development. Results should be reviewed carefully before use in production. Report issues at https://github.com/adobe/skills/issues
This pattern is executed by the code-assessment runbook — follow
../references/runbook.mdfor the full flow (preflight → plan → apply → verify, run log). This skill supplies the detection + recipe the runbook applies.
AEM as a Cloud Service enforces a list of deprecated and removed Java packages, Maven artifacts,
and OSGi PID configurations via the Build Analyzer Maven Plugin. Code that imports
these packages, declares the removed dependencies, or ships the unmodifiable PIDs fails Cloud
Manager code-quality pipelines. This pattern scans the workspace for all three violation
categories and remediates them with direct LLM-applied edits using the replacement mappings in
recipe.md, followed by an AI-assisted build-error fix loop for anything that needs compilation
fixes after the import/dep changes.
*.java file importing a package in the deprecated/removed API list (e.g. org.apache.log4j,
com.google.common, org.apache.commons.lang, org.eclipse.jetty, ch.qos.logback, etc.)pom.xml declaring a Maven dependency on a deprecated artifact (e.g. logback, log4j,
guava, mongo-java-driver, abdera).cfg, .cfg.json, .config) declaring a PID that AEM CS
marks as unmodifiable (e.g. org.apache.sling.commons.log.LogManager)api-regions-check, Import-Package,
or bundle-unversioned-packages violations for these APIsOnly APIs whose enforcement deadline is ≤ today are in scope — future-deadline APIs are detected but skipped.
Run the bundled analyzer from the repo root:
bash plugins/aem/cloud-service/skills/code-assessment/scripts/analyze.sh <root> --pattern remove-deprecated-api
The detector checks Java import statements against deprecated package prefixes, Maven <dependency> entries against deprecated coordinates, and OSGi config filenames (.cfg, .cfg.json, .config) against the unmodifiable PID list. Only rules whose enforcement deadline has already passed are active; future-deadline rules are silently skipped.
Java imports (already-enforced, always active):
import org.apache.sling.commons.auth
import org.eclipse.jetty.
import com.mongodb.
import org.apache.abdera.
import org.apache.felix.http.whiteboard
import ch.qos.logback.
import org.slf4j.spi.
import org.slf4j.event.
import org.apache.log4j.
import com.google.common.
import org.apache.cocoon.xml.
import org.apache.felix.webconsole.
import com.drew.
import org.apache.jackrabbit.oak.plugins.memory
Maven dependencies (already-enforced):
logback log4j guava mongo-java-driver abdera
OSGi config PIDs (already unmodifiable):
org.apache.sling.commons.log.LogManager
org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet
com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl
org.apache.http.proxyconfigurator
com.day.cq.auth.impl.cug.CugSupportImpl
com.day.cq.jcrclustersupport.ClusterStartLevelController
Additional import prefixes and Maven artifacts become active once their enforcement date passes;
see the Enforcement scope section in recipe.md for the date-gated groups.
Scope: workspace roots only. Exclude code-assessment/ skill files.
self-evident — all replacement mappings are embedded in recipe.md Step 3 tables. No user-supplied target versions or replacements are required.
Manual-only items (cannot be auto-fixed; document in report, do not attempt edits):
org.apache.felix.webconsole.* references — webconsole is unavailable on Cloud Service; requires
rethinking the admin/debug approach entirely.Lists.newArrayList() / ImmutableList.of() (caching,
event bus, complex data structures) — replacement requires design decisions.mvn compile)// Fixed by AEM Modernizer AI above the changemvn compile)aemanalyser-maven-plugin) to catch OSGi wiring issues| Symptom | Likely cause | Action |
|---|---|---|
| Import-Package not satisfied from Build Analyzer | Deprecated import removed but no replacement provided | Check the import mapping table in recipe.md Step 3; verify the replacement package is on the bundle's classpath |
| Build error after editing an XSS API import | Replacement class has a different method signature | AI-fix phase — see Common Fix Patterns in recipe.md |
| Unresolved symbol after replacing a commons-lang import | v2 → v3 method name changed | AI-fix phase — see commons-lang fix patterns in recipe.md |
| aemanalyser-maven-plugin not in pom.xml | Plugin not yet wired into the project | Add permanently per recipe.md Step 6b |
Read recipe.md fully before applying. The recipe covers the input contract,
per-category locators and replacement mappings, skip / unlocatable reasons, common AI-fix patterns,
before/after examples, and the complete multi-step execution procedure (initial build → LLM edits →
post-edit build → AI-fix loop → final build → Build Analyzer → report).
tools
Use the run-workflow MCP to discover, compose, execute, publish, and save Adobe Firefly workflows. TRIGGER when: user asks what actions are available, what the MCP can do, how to process images/video/3D via workflow, wants to build/run/save/publish a workflow, OR pastes any workflow/batch/execution ID. BARE ID (UUID/workflowId/batchId) = INSPECT ONLY — call inspect_run, NEVER run_workflow_submit. ALWAYS call list_actions first for capability/discovery questions. DO NOT TRIGGER for direct Firefly API calls without MCP (use firefly-api-specs).
tools
Run predefined featured workflows via run-workflow MCP. TRIGGER when user names a featured workflow (retargeting, banners at scale, localization, packaging, banner advertising, etc.) or asks to run a known marketing/production workflow. Requires run-workflow MCP. ALWAYS call get_featured_workflow before compose_workflow. DO NOT TRIGGER for custom one-off workflows with no named template — use run-workflow skill.
tools
Migrate an Adobe Commerce App Builder project from the Integration Starter Kit or Checkout Starter Kit to the new App Management approach. Run from the root of the App Builder project to be migrated. Pass --auto to skip confirmation prompts (suitable for CI or batch use) — auto mode prints a summary of all Q&A questions answered with their defaults. Pass --doc-scan-only to scan README.md and env.dist for outdated content without modifying any files. Use when the user wants to migrate an App Builder project from the Integration Starter Kit or Checkout Starter Kit to the App Management approach, or mentions upgrading their Adobe Commerce extension architecture.
development
Add or modify webhook interceptors in an Adobe Commerce app. Use when the user wants to intercept Commerce operations to validate input, append data, or modify behavior — before or after execution. Requires a base app initialized with commerce-app-init.