You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

本地启动AEM项目构建时遇maven-scr-plugin错误,求排查方向

Troubleshooting Maven SCR Plugin Error in AEM Project

Hey there, sorry to hear you're hitting this roadblock while setting up your new AEM project locally! Since you've already verified your Java and Maven versions are good, let's dive into other common troubleshooting angles:

  • Verify SCR Plugin & AEM Version Compatibility
    The maven-scr-plugin:1.17.0 might not align with your AEM version. For example, newer AEM versions (like 6.5+) often recommend using the BND plugin instead of the legacy SCR plugin. Check your project's documentation or AEM's internal compatibility notes to confirm if this plugin version is supported for your target AEM instance.

  • Inspect OSGi Component Annotations
    The SCR plugin processes OSGi component annotations like @Component, @Service, and @Reference. A tiny syntax error (missing parentheses, invalid attribute values, or incomplete annotations) in any of your component classes can break the plugin execution. Try building individual modules one by one to narrow down which module/class is causing the issue.

  • Clean Maven Cache & Rebuild
    Corrupted dependencies in your local Maven repository can cause unexpected plugin failures. Run these steps:

    1. Execute mvn clean install -U to clean target directories and force-update dependencies
    2. Delete the SCR plugin's cached files from your local repo: ~/.m2/repository/org/apache/felix/maven-scr-plugin/1.17.0
    3. Rebuild the project from scratch
  • Check Multi-Module Project Configuration
    If your project has multiple modules, ensure the parent POM's plugin configuration is correctly inherited by all child modules. Look for any child modules that might override the SCR plugin version or configuration incorrectly.

  • Get Full Error Stack Trace
    The truncated error message only tells part of the story. Re-run your build with the -e flag (mvn clean install -e) to get the complete stack trace. This will usually point to the exact class, annotation, or dependency that's causing the plugin to fail.

  • Adjust Maven JVM Memory Settings
    Sometimes insufficient JVM memory during build can crash the SCR plugin. Update your MAVEN_OPTS environment variable to allocate more memory, for example:

    export MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=512m"
    

    (Adjust values based on your machine's available RAM)

内容的提问来源于stack exchange,提问作者Pavlo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:55:13