Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM Project Compilation Issue

Avatar

Level 2

The problem you're facing during the compilation of your AEM (Adobe Experience Manager) project is related to the "mvn clean install -PautoInstallSinglePackage" command. When executing this command, you're encountering an error in the "target" folder within "generated-sources/htl". It appears that the build process is unable to delete these files during compilation.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on project aem-projectexample-project.ui.apps: Failed to clean project: Failed to delete C:\Users\user\aem-sdk-projectexample\project\project\ui.apps\target\generated-sources\htl\org\apache\sling\scripting\sightly\apps\projectexample\components\xfpage -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :aem-projectexample-project.ui.apps

1 Accepted Solution

Avatar

Correct answer by
Level 8

@Johnhenao10 ,

Please try deleting the target folder from ui.apps module manually and try the build again. Some times the clean commands doesn't execute as expected. Maybe due to file type or folder permissions.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 8

@Johnhenao10 ,

Please try deleting the target folder from ui.apps module manually and try the build again. Some times the clean commands doesn't execute as expected. Maybe due to file type or folder permissions.

Avatar

Level 8

@Johnhenao10 Most likely there is another process holding a lock on this folder. Most of the times (at least for me) the culprit is the IDE (eclipse, intelliJ).

Try closing the IDE and then run the build.

Avatar

Community Advisor

Hi @Johnhenao10 

Try mvn clean alone or deleting the file by following the folder structure and run mvn clean install.

Avatar

Community Advisor

Hello @Johnhenao10 

 

1. Please assure target folder is not accessed in any command line or other tool

2. Restart IDE

3. Sometimes, we might still not be able to resolve. So, restart system


Aanchal Sikka

Avatar

Community Advisor

@Johnhenao10  All the suggestions provided by Advisors are correct. Basically this happens when the mvn is unable to delete the target folder while you run the mvn command. 

 

Below are the solutions

1. If you run the "cmd" with admin privelages

2.if you can run mvn clean before you run mvn install that also helps. 

3. If another program is using the target folder please close it and rerun it once again.