Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

In Maven when using a aem-api (version 6.0.0.1 at the moment of writing) dependency with some never API dependencies (i.e Sling Models) I run into strange errors like

Jira Legacy
serverJIRA (wcm-io.atlassian.net)
serverId189eb916-1cf0-3fea-a998-f8364b2c8095
keyWCMIO-54
 

Solution

Dependency order matters here. Since aem-api is not a dependency with provided transient dependencies, but a simple collection of .jar files, make sure it is always coming AFTER the never API dependencies.  

Code Block
titlepom.xml
<dependencies>
	<dependency>
		<groupId>org.apache.sling</groupId>
		<artifactId>org.apache.sling.models.api</artifactId>
		<version>1.1.0</version>
		<scope>provided</scope>
	</dependency>
	.
	.
	.
	<dependency>
    	<groupid>com.adobe.aem</groupid>
    	<artifactid>aem-api</artifactid>
    	<version>6.0.0.1</version>
    	<scope>provided</scope>
	</dependency>
</dependencies>

Filter by label (Content by label)
showLabelsfalse
max5
spacesWCMIO
showSpacefalse
sortmodified
reversetrue
typepage
labelskb-troubleshooting-article

...