Expand my Community achievements bar.

SOLVED

Problems building the project created by the aem-project-archetype-aem-project-archetype-27

Avatar

Level 2

I have downloaded the aem-project-archetype-aem-project-archetype-27 package, completed the mvn clean install process. Then I created the new project using the batch method described in the README.md file. Now I change to the generated folder and run mvn clean install to build that sub project and I receive the following error:

[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute (archetype-pre-package-transformation) on project apple: Execution archetype-pre-package-transformation of goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute failed: startup failed:
[ERROR] script1.groovy: 1: Unexpected input: '\' @ line 1, column 3.
[ERROR] C:\dev\aem-project-archetype-aem-project-archetype-27\apple/src/main/resources/META-INF/archetype-pre-package.groovy
[ERROR] ^
[ERROR]
[ERROR] 1 error
[ERROR]
[ERROR] -> [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/PluginExecutionException

 

I have recreated the project several times with different settings and each time, I encounter this error. I have yet to find a solution by searching the web.

The operating system is Windows 10

 

Thanks in advance for your help.

1 Accepted Solution

Avatar

Correct answer by
Level 2

I think I have the answer. In the root project pom, there is a <parent> section that refers to the online archetype. I commented out that section and it no longer has the issue with the groovy compiler and now builds fine.

View solution in original post

11 Replies

Avatar

Community Advisor

Hi @FuguSailor 

 

   I am assuming you are mentioning about creating a project from scratch. I am not sure how you are doing it with the steps you mentioned. May be if you cross check your steps with https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel... and see if you are following the steps properly , may be that would help. 

 

Thanks

Veena

Avatar

Level 2

This is the command line I used to create the new project:
C:\dev\aem-project-archetype-aem-project-archetype-27\apple>mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=27 -D appTitle="Apple Test" -D appId="apple" -D groupId="com.apple" -D enableDynamicMedia=y -D aemVersion=6.5 -D includeDispatcherConfig=n -D frontendModule=general -D includeErrorHandler=y

Avatar

Level 2
The documentation doesn't help with fixing the issue. My problem is after the project is created but in the pre build stage. I'm not sure why it is calling groovy. Even when I change to the core folder, I get the same result.

Avatar

Correct answer by
Level 2

I think I have the answer. In the root project pom, there is a <parent> section that refers to the online archetype. I commented out that section and it no longer has the issue with the groovy compiler and now builds fine.

Avatar

Level 3
Can point to the specific line . I am facing the issue too

Avatar

Level 2
There wasn't a change to the pom. When I looked at the uber-jar-6.5.0.jar file in the .m2 tree, it was far too small. I manually went to the repository and downloaded the uber-jar-6.5.0-release.jar and replaced the original uber-jar with that one. That archive was good enough to get going.

Avatar

Level 6

I have Created a new AEM Project with Archetype 26 and i faced the below issue and resolve it.

1. Setup Java 11(Recommended)
2. Setup AEM 6.5 Instance. Once AEM is setup then installed the "aem-service-pkg-6.5.4.zip" service package.
3. Create a new Project structure using the below command:
mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=26 -D appTitle="My Project" -D appId="myproject" -D groupId="com.myproject.aem" -D artifactId="myproject-aem-project" -D version="0.0.1-SNAPSHOT" -D aemVersion="6.5.4" -D includeDispatcherConfig=n -D includeExamples=n
Whenever run the above command getting below error while creating a project structure with dispatcher modules.

ERROR : Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project standalone-pom: java.nio.file.FileSystemException: Project path(Example: /Myproject/): A required privilege is not held by the client. -> [Help 1]
4. To fix the above error i have not included dispatcher modules by adding "includeDispatcherConfig=n" parameter in command, So remove this from command and run.

5. Project structure got created successfully as per the below.

keshavc60185412_0-1622531852401.png

 

Avatar

Level 3
I was facing similar issue . Looks like groovy scripts in archetype project is trying to resolve groovy dependencies from maven repo(.m2/repository) and failing as it can not find . Ideally it should be looking in groovy repo. However I did a hack to solve this issue. Downloaded the dependency to Maven repo through command line and I was able to successfully build

Avatar

Level 2
I was building a new project from scratch using archetype 27, and I had exactly the same problem. Setting "includeDispatcherConfg" to "n" resolved my issue! Big thanks!