Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

WKND SPA React build error

imalakaamir
Level 2
Level 2

Hi community,

 

i am going through second chapter of wknd spa tutorial where add a new component to the SPA and deploy the changes to a local AEM instance, here is the link

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/s...

and when tried to build the ui.apps module and getting error

$ cd ../ui.apps
$ mvn clean install -PautoInstallPackage

imalakaamir_1-1631426308567.png

 

imalakaamir_0-1631426118343.png

Could someone please assist what could have gone wrong here.

 

Appreciate your help.


Thanks

1 Accepted Solution
kishorekumar14
Correct answer by
Level 9
Level 9

Hi @imalakaamir ,

 

mvn clean install -PautoInstallPackage

Lets split this command.

 

  • mvn clean - It will delete the target folder.
  • mvn clean install - It will delete the target folder and install the content package (based on packaging type mentioned in pom.xml) in the target folder and also in local repository (.m2 folder).
  • mvn clean install -PautoInstallPackage - It is a maven profile. It will pick the content package and install in your local AEM instance.

For you mvn clean itself failing. It is not able to delete the target folder. PFB some of the reason where it will fail.

https://maven.apache.org/plugins/maven-clean-plugin/faq.html
https://stackoverflow.com/questions/19489720/maven-failed-to-clean-project-failed-to-delete-org-ow2-...

 

View solution in original post

0 Replies
kishorekumar14
Level 9
Level 9

Hi @imalakaamir ,

 

Delete the target folder in ui.apps folder manually and then try to build it.

imalakaamir
Level 2
Level 2

Hi @kishorekumar14 ,

 

Thanks for the advise bit reluctant of deleting the whole folder manually as i don't understand what's happening in ui.app/target folder - sorry i am still very new to AEM, apologies.  Would you mind pointing me some link or doc in order to understand more about ui.app/target. I tried googling it but couldn't see much tbh.

 

Thanks once again.

 

 

kishorekumar14
Correct answer by
Level 9
Level 9

Hi @imalakaamir ,

 

mvn clean install -PautoInstallPackage

Lets split this command.

 

  • mvn clean - It will delete the target folder.
  • mvn clean install - It will delete the target folder and install the content package (based on packaging type mentioned in pom.xml) in the target folder and also in local repository (.m2 folder).
  • mvn clean install -PautoInstallPackage - It is a maven profile. It will pick the content package and install in your local AEM instance.

For you mvn clean itself failing. It is not able to delete the target folder. PFB some of the reason where it will fail.

https://maven.apache.org/plugins/maven-clean-plugin/faq.html
https://stackoverflow.com/questions/19489720/maven-failed-to-clean-project-failed-to-delete-org-ow2-...

 

View solution in original post

asutosh_jena
Community Advisor
Community Advisor

Hi @imalakaamir 

 

Everytime we try to build the project by running the command (mvn clean install), maven will clean the target folder of all the modules and will build the project. Once the build is completed, the generated artifact i.e., zip or jar will be placed under the target folder for the specific module.

 

If it's a core module, jar file will be placed under target and if it's a ui.apps or ui.content module, zip file will be placed under the target module.

 

Here in this case, maven is not able to clean the target folder which is why you are getting an error while building the project. Please go ahead and delete the target folder under ui.apps and try to rebuild the project. It will fix the build issue.

 

Please follow the below link to know more about the maven commands which are used to clean the target folder.

https://github.com/AdobeDocs/experience-manager-cloud-service.en/blob/master/help/implementing/devel...

 

Archetype defining different folder structure here:

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetyp...

 

Thanks!