adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
541 stars 417 forks source link

Maven error building with profile `autoInstallPackage` #131

Closed andyklimczak closed 5 years ago

andyklimczak commented 5 years ago

I'm getting a maven dependency error for plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 when trying to build after creating a new project. I'm running 6.4 locally.

I try building with mvn clean install -PautoInstallPackage then get an error.

Full error:

[INFO] Scanning for projects...
[WARNING] The POM for com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 is missing, no dependency information available
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ 
[ERROR] Unknown packaging: content-package @ com.andy.nbapageflow:nbaPageFlow.ui.apps:[unknown-version], /home/andy/Dev/nbaPageFlow/ui.apps/pom.xml, line 34, column 16
[ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ 
[ERROR] Unknown packaging: content-package @ com.andy.nbapageflow:nbaPageFlow.ui.content:[unknown-version], /home/andy/Dev/nbaPageFlow/ui.content/pom.xml, line 34, column 16
 @ 
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]   
[ERROR]   The project com.andy.nbapageflow:nbaPageFlow.ui.apps:1.0-SNAPSHOT (/home/andy/Dev/nbaPageFlow/ui.apps/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR]     Unknown packaging: content-package @ com.andy.nbapageflow:nbaPageFlow.ui.apps:[unknown-version], /home/andy/Dev/nbaPageFlow/ui.apps/pom.xml, line 34, column 16
[ERROR]   
[ERROR]   The project com.andy.nbapageflow:nbaPageFlow.ui.content:1.0-SNAPSHOT (/home/andy/Dev/nbaPageFlow/ui.content/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR]     Unknown packaging: content-package @ com.andy.nbapageflow:nbaPageFlow.ui.content:[unknown-version], /home/andy/Dev/nbaPageFlow/ui.content/pom.xml, line 34, column 16
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException

Steps to reproduce:

I created a new project based on the archtype via the command line:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \
 -DarchetypeGroupId=com.adobe.granite.archetypes \
 -DarchetypeArtifactId=aem-project-archetype \
 -DarchetypeVersion=15 \
 -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/

then I try to build using: mvn clean install -P autoInstallBundle,autoInstallPackage to AEM 6.4 and get the error

I don't get the error when I do a plain mvn clean install The repo for the project is here: https://github.com/andyklimczak/AEM-NBA-create-page-flow. It's a prototype project and doesn't contain any changes from the mvn archetype.

Thank you!

vladbailescu commented 5 years ago

You need to add the Adobe Nexus to your Maven settings.xml as described here: https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/ht-projects-maven.html

godanny86 commented 5 years ago

@vladbailescu, an alternative we have seen is to add the adobe-public profile to the command line argument i.e:

mvn -PautoInstallPackage -Padobe-public clean install

Is there any downside to this approach (vs. updating settings.xml) ?

vladbailescu commented 5 years ago

@godanny86 That just makes sure it's activated. It needs to be defined either in settings.xml or in the project's [parent] pom.xml

vladbailescu commented 5 years ago

The archetype already adds the profile to the project's reactor pom.xml and it should activate automatically: https://github.com/Adobe-Marketing-Cloud/aem-project-archetype/blob/master/src/main/archetype/pom.xml#L315-L360

Adding -Padobe-public will force it to activate anyway.

andyklimczak commented 5 years ago

doing mvn -PautoInstallPackage -Padobe-public clean install seemed to work out

I would double check if editing settings.xml is necessary and if the the adobe-public profile is automatically active

I'll close this, but will update again if something else pops up, thanks!

algo-circle commented 4 years ago

@andyklimczak I too was facing the same issue. I created a dummy project using AEM archetype 20. I'm using AEM 6.5. mvn clean install was runing fine but when I tried to deploy it on the running instance it threw the same error. The command I typed was mvn clean install -PautoInstallPackage. But using mvn -PautoInstallPackage -Padobe-public clean install worked.

I don't know why the former command failed and gave the error:

[ERROR] Unknown packaging: content-package @ line 34, column 16 [ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ [ERROR] Unknown packaging: content-package @ line 34, column 16 [WARNING] 'build.pluginManagement.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin biz.aQute.bnd:bnd-maven-plugin @ line 240, column 25 @ [ERROR] The build could not read 2 projects -> [Help 1] [ERROR] [ERROR] The project com.ttn.bootcamp:com.ttn.bootcamp.training.ui.apps:1.0-SNAPSHOT (/home/rohit/aem/com.ttn.bootcamp.training/ui.apps/pom.xml) has 2 errors [ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2] [ERROR] Unknown packaging: content-package @ line 34, column 16 [ERROR] [ERROR] The project com.ttn.bootcamp:com.ttn.bootcamp.training.ui.content:1.0-SNAPSHOT (/home/rohit/aem/com.ttn.bootcamp.training/ui.content/pom.xml) has 2 errors [ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:1.0.2 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2] [ERROR] Unknown packaging: content-package @ line 34, column 16 [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/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException rohit@Rohit-Kapoor:com.ttn.bootcamp.training $