We have an Adobe AEM project which was created with com.adobe.aem.aem-project-archetype version 50. The local build is running fine without issues.
Now we'd like to create releases using maven release in a Bitbucket Pipeline (hosted on bitbucket.org).
However, running any maven command within the pipeline, dependencies are downloaded first and then we are getting the following errors:
[ERROR] The build could not read 5 projects -> [Help 1]
[ERROR]
[ERROR] The project com.example:project.all:0.0.1-SNAPSHOT (/opt/atlassian/pipelines/agent/build/all/pom.xml) has 1 error
[ERROR] Unknown packaging: content-package @ line 35, column 16
[ERROR]
[ERROR] The project com.example:project.ui.apps:0.0.1-SNAPSHOT (/opt/atlassian/pipelines/agent/build/ui.apps/pom.xml) has 1 error
[ERROR] Unknown packaging: content-package @ line 34, column 16
[ERROR]
[ERROR] The project com.example:project.ui.apps.structure:0.0.1-SNAPSHOT (/opt/atlassian/pipelines/agent/build/ui.apps.structure/pom.xml) has 1 error
[ERROR] Unknown packaging: content-package @ line 19, column 16
[ERROR]
[ERROR] The project com.example:project.ui.config:0.0.1-SNAPSHOT (/opt/atlassian/pipelines/agent/build/ui.config/pom.xml) has 1 error
[ERROR] Unknown packaging: content-package @ line 34, column 16
[ERROR]
[ERROR] The project com.example:project.ui.content:0.0.1-SNAPSHOT (/opt/atlassian/pipelines/agent/build/ui.content/pom.xml) has 1 error
[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
The bitbucket-pipelines.yml looks as follows:
pipelines:
branches:
release:
- step:
name: Create Release Version
trigger: automatic
caches:
- maven
script:
- git config --global user.email "[email protected]"
- git config --global user.name "Bitbucket Pipeline"
- mvn -B -s settings.xml -DdryRun=true release:prepare
- mvn -B -s settings.xml release:clean release:prepare
The referenced settings.xml references https://repo.adobe.com/nexus/content/groups/public and https://repo.maven.apache.org/maven2 for both, and .
The content-package-maven-plugin is located in the main pom.xml, in project > build > pluginManagement > plugins (as it is standard with the archetype we've used):
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<version>1.0.6</version>
<configuration>
<targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
<failOnError>true</failOnError>
<userId>${vault.user}</userId>
<password>${vault.password}</password>
</configuration>
</plugin>
Any ideas what could be the issue here?
After some more research, I found the solution. Just had to add
image: maven:3.9.5
as first line in my bitbucket-pipelines.yml. So mostly down to me not being that familiar with Bitbucket Pipelines, yet.